tailscale.sh aktualisiert

This commit is contained in:
2024-09-14 09:15:51 +02:00
parent 1ca26dcd59
commit b2e4d7e997

View File

@@ -25,8 +25,7 @@ if [[ ! -f /usr/bin/tailscale || ! -f /usr/bin/tailscaled ]]; then
if [ ! -z "${TAILSCALE_EXIT_NODE_IP}" ]; then if [ ! -z "${TAILSCALE_EXIT_NODE_IP}" ]; then
if [ ! -c /dev/net/tun ]; then if [ ! -c /dev/net/tun ]; then
echo "ERROR: Device /dev/net/tun not found!" echo "ERROR: Device /dev/net/tun not found!"
echo " Make sure to pass through /dev/net/tun to the container and add the" echo " Make sure to pass through /dev/net/tun to the container."
echo " parameter --cap-add=NET_ADMIN to the Extra Parameters!"
exit 1 exit 1
fi fi
APT_IPTABLES="iptables " APT_IPTABLES="iptables "
@@ -37,6 +36,14 @@ if [[ ! -f /usr/bin/tailscale || ! -f /usr/bin/tailscaled ]]; then
apt-get -y install --no-install-recommends jq wget ${APT_IPTABLES}>/dev/null 2>&1 apt-get -y install --no-install-recommends jq wget ${APT_IPTABLES}>/dev/null 2>&1
echo "Done" echo "Done"
if [ "${APT_IPTABLES}" == "iptables " ]; then
if ! iptables -L >/dev/null 2>&1; then
echo "ERROR: Cap: NET_ADMIN not available!"
echo " Make sure to add --cap-add=NET_ADMIN to the Extra Parameters"
exit 1
fi
fi
echo "Tailscale not found, downloading..." echo "Tailscale not found, downloading..."
echo "Please wait..." echo "Please wait..."
@@ -181,4 +188,4 @@ if [ ! -z ${TAILSCALE_SERVE_PORT} ]; then
echo "Enabling Serve! See https://tailscale.com/kb/1312/serve" echo "Enabling Serve! See https://tailscale.com/kb/1312/serve"
eval tailscale serve --bg --"${TAILSCALE_SERVE_MODE}"=443${TAILSCALE_SERVE_PATH} http://localhost:"${TAILSCALE_SERVE_PORT}${TAILSCALE_SERVER_LOCALPATH}" eval tailscale serve --bg --"${TAILSCALE_SERVE_MODE}"=443${TAILSCALE_SERVE_PATH} http://localhost:"${TAILSCALE_SERVE_PORT}${TAILSCALE_SERVER_LOCALPATH}"
fi fi
fi fi