aboutsummaryrefslogtreecommitdiff
path: root/network/syncthing/rc.syncthing
blob: 9e13fac946925ae031c9c9a366447c9e11e495dc (plain)
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
#!/bin/sh
#
# syncthing start script

case "$1" in
	stop)
		PID=/var/run/syncthing/syncthing.pid
		if [ -f $PID ]; then
        		echo "Stop Syncthing..."
        		kill "`cat /var/run/syncthing/syncthing.pid`"
		else
			echo "Syncthing is not running..."
			exit 1
		fi
        	;;
	start)
        	echo "Start Syncthing..."
        	/usr/bin/syncthing
        	;;
	restart)
        	$0 stop
        	sleep 1
        	$0 start
        	;;
	*)
        	echo "usage: $0 { start | stop | restart }" >&2
        	exit 1
        	;;
esac