Skip to content

Instantly share code, notes, and snippets.

@avh4
Created October 30, 2013 04:51
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avh4/7227373 to your computer and use it in GitHub Desktop.
Save avh4/7227373 to your computer and use it in GitHub Desktop.
startup script for running BitTorrent Sync on Synology NAS
#!/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