aboutsummaryrefslogtreecommitdiff
path: root/network/btsync/rc.btsync
blob: 71bf757e168db1930884272384372e5226c9fb06 (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
#
# btsync start script

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