23 lines
487 B
Bash
23 lines
487 B
Bash
#!/bin/sh
|
|
|
|
case "$1" in
|
|
start)
|
|
echo "Starting tailscaled..."
|
|
tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/var/run/tailscale/tailscaled.sock --tun=userspace-networking > /dev/null 2>&1 &
|
|
;;
|
|
stop)
|
|
echo "Stopping tailscaled..."
|
|
killall tailscaled
|
|
;;
|
|
restart)
|
|
$0 stop
|
|
sleep 1
|
|
$0 start
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0 |