mirror of
https://github.com/Mo3he/Axis_Cam_Tailscale.git
synced 2026-10-01 12:05:37 +00:00
The tailscaled.state file in localdata will now persist across updates, so your camera stays connected to Tailscale without re-authentication
31 lines
711 B
Bash
Executable File
31 lines
711 B
Bash
Executable File
#!/bin/sh
|
|
|
|
echo "Starting Service"
|
|
|
|
# Define paths
|
|
APP_DIR="/usr/local/packages/Tailscale_VPN"
|
|
STATE_DIR="$APP_DIR/localdata"
|
|
|
|
# Create localdata directory if it doesn't exist
|
|
mkdir -p "$STATE_DIR"
|
|
|
|
# Set permissions
|
|
chmod 777 "$APP_DIR/lib/tailscale"
|
|
chmod 777 "$APP_DIR/lib/tailscaled"
|
|
|
|
# Start tailscaled with state stored in localdata
|
|
"$APP_DIR/lib/tailscaled" \
|
|
--state="$STATE_DIR/tailscaled.state" \
|
|
--socket="$STATE_DIR/tailscaled.sock" \
|
|
--socks5-server=localhost:1055 \
|
|
--tun=userspace-networking &
|
|
|
|
echo "Service Started"
|
|
sleep 2
|
|
echo "Scroll to Bottom for link"
|
|
|
|
# Run tailscale up with the socket in localdata
|
|
"$APP_DIR/lib/tailscale" --socket="$STATE_DIR/tailscaled.sock" up
|
|
|
|
wait
|