Skip to content

Commit

Permalink
src/tailscale: improve compatibility of io redirects (#32)
Browse files Browse the repository at this point in the history
Fixes #26
  • Loading branch information
raggi authored Mar 6, 2024
1 parent bdf0572 commit 76dd558
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/tailscale/tailscaled-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ set -euxo pipefail
export TS_DEBUG_FIREWALL_MODE=auto
if [[ "$(id -u)" -eq 0 ]]; then
mkdir -p /workspaces/.tailscale || true
/usr/local/sbin/tailscaled \
2>/dev/null >/dev/null \
/usr/local/sbin/tailscaled \
--statedir=/workspaces/.tailscale/ \
--socket=/var/run/tailscale/tailscaled.sock \
--port=41641 \
&> /dev/null &
elif command -v sudo &> /dev/null; then
sudo --non-interactive sh -c 'mkdir -p /workspaces/.tailscale ; /usr/local/sbin/tailscaled \
--port=41641 &
elif command -v sudo > /dev/null; then
sudo --non-interactive mkdir -p /workspaces/.tailscale
2>/dev/null >/dev/null \
sudo --non-interactive \
/usr/local/sbin/tailscaled \
--statedir=/workspaces/.tailscale/ \
--socket=/var/run/tailscale/tailscaled.sock \
--port=41641 &> /dev/null' &
--port=41641 &
else
echo "tailscaled could not start as root." 1&>2
>&2 echo "tailscaled could not start as root."
fi
unset TS_DEBUG_FIREWALL_MODE

Expand Down

0 comments on commit 76dd558

Please sign in to comment.