-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
39 lines (30 loc) · 891 Bytes
/
start.sh
File metadata and controls
39 lines (30 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
set -e
echo "Starting Tailscale daemon..."
tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/var/run/tailscale/tailscaled.sock &
TAILSCALED_PID=$!
# Wait for tailscaled to start
sleep 2
echo "Authenticating with Tailscale..."
if [ -z "$TAILSCALE_AUTH_KEY" ]; then
echo "ERROR: TAILSCALE_AUTH_KEY environment variable is not set"
exit 1
fi
tailscale up --authkey="$TAILSCALE_AUTH_KEY" --hostname=taildrop-me
echo "Waiting for Tailscale to be ready..."
for i in $(seq 1 30); do
if tailscale status > /dev/null 2>&1; then
echo "Tailscale is ready!"
break
fi
echo "Waiting for Tailscale... ($i/30)"
sleep 1
done
if ! tailscale status > /dev/null 2>&1; then
echo "ERROR: Tailscale failed to connect"
exit 1
fi
echo "Tailscale status:"
tailscale status
echo "Starting taildrop.me application..."
exec ./taildrop-me