### BEGIN INIT INFO # Provides: btsync # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Manage BitTorrentSync daemon # Description: http://labs.bittorrent.com/experiments/sync.html ### END INIT INFO DAEMON=/usr/local/bin/btsync DAEMON_OPTS="--config /usr/local/etc/btsync/nonwebui.conf" DAEMON_CONF="/home/btsync/.btsync" DAEMON_USER=btsync PIDFILE=/home/btsync/btsync.pid NAME=btsync DESC=btsync test -x $DAEMON || exit 0 case "$1" in start) echo -n "Starting $DESC: " start-stop-daemon --start --chuid $DAEMON_USER --user $DAEMON_USER --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --user $DAEMON_USER --pidfile $PIDFILE --exec $DAEMON echo "$NAME." ;; restart|force-reload) echo -n "Restarting $DESC: " rm -fr $DAEMON_CONF start-stop-daemon --stop --exec $DAEMON sleep 2 start-stop-daemon --start --chuid $DAEMON_USER --user $DAEMON_USER --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; #reload) # echo -n "Reloading $DESC configuration: " # start-stop-daemon --stop --signal HUP --quiet --user $USER --exec $DAEMON # echo "$NAME." # ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0