Created
October 30, 2013 04:51
-
-
Save avh4/7227373 to your computer and use it in GitHub Desktop.
startup script for running BitTorrent Sync on Synology NAS
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 | |
# | |
# Put this file in /usr/local/etc/rc.d/btsync.sh | |
case "$1" in | |
stop) | |
echo "Stop BitTorrent Sync..." | |
kill "`cat /volume1/homes/btsync/bin/.sync/sync.pid`" | |
kill "`cat /volume1/homes/btsync/bin/.sync/sync.pid`" | |
;; | |
start) | |
su btsync -c "/volume1/homes/btsync/bin/btsync --config /volume1/homes/btsync/conf/sync.conf" | |
;; | |
restart) | |
$0 stop | |
sleep 1 | |
$0 start | |
;; | |
status) | |
ps | grep bin/btsync | grep -q -v grep | |
return $? | |
;; | |
*) | |
echo "usage: $0 { start | stop | restart | status}" >&2 | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment