Last active
August 29, 2015 13:58
-
-
Save rmamba/9985411 to your computer and use it in GitHub Desktop.
btsyncd start up script goes into /etc/init.d/btsyncd on RaspberryPi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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