mirror of
https://github.com/Mo3he/Axis_Cam_Tailscale.git
synced 2026-10-01 03:55:40 +00:00
The tailscaled.state file in localdata will now persist across updates, so your camera stays connected to Tailscale without re-authentication
29 lines
657 B
Bash
Executable File
29 lines
657 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" &
|
|
|
|
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 --accept-routes
|
|
|
|
wait
|