Skip to content

Instantly share code, notes, and snippets.

@rmamba
Last active August 29, 2015 13:58
Show Gist options
  • Save rmamba/9985411 to your computer and use it in GitHub Desktop.
Save rmamba/9985411 to your computer and use it in GitHub Desktop.
btsyncd start up script goes into /etc/init.d/btsyncd on RaspberryPi
#!/bin/sh
#sudo update-rc.d btsyncd defaults
BTSYNCPATH=/home/pi/BTSync
do_start () {
$BTSYNCPATH/btsync --config $BTSYNCPATH/btsync.conf
}
do_status () {
echo "Process ID at: "
cat $BTSYNCPATH/.sync/sync.pid
echo
}
do_stop () {
kill -9 `cat $BTSYNCPATH/.sync/sync.pid`
rm $BTSYNCPATH/.sync/sync.pid
}
case "$1" in
start|"")
do_start
;;
restart|reload|force-reload)
do_stop
sleep 4
do_start
;;
stop)
do_stop
;;
status)
do_status
exit $?
;;
*)
echo "Usage: btsyncd [start|stop|status]" >&2
exit 3
;;
esac
:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment