Auto Staring btsync (Bit Torrent Sync) / SyncApp on CentOS

I used to use this software, and wanted to share the init script I've been using:
#!/bin/bash
#
# Super ultra basic startup script for btsync
#
# chkconfig: 345 55 25
# description: bittorrent sync
# processname: btsync
# pidfile:
# config:

# Source function library
. /etc/init.d/functions

# Get network config
. /etc/sysconfig/network

if [ -f /etc/sysconfig/btsync ]; then
. /etc/sysconfig/btsync
fi

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 1

if [ ! -f $BIN ] ; then
echo "missing binary: $BIN"
exit 1;
fi

if [ ! -f $CONF ] ; then
echo "missing configuration: $CONF"
echo "run $BIN --dump-sample-config to create a default configuration"
exit 6;
fi

if [ -z $USER ] ; then
USER=root
fi

start() {
DIR=$(dirname "${PID}")
if [ ! -d "$DIR" ] ; then
mkdir $DIR
fi
daemon --pidfile $PID --user $USER $BIN --config $CONF
echo_success
}

stop() {
killproc -p $PID $BIN
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status -p $PID $BIN
;;
*)
echo "usage: $0 {start|stop|restart|status}"
;;
esac
exit 0;


And then the /etc/sysconfig/btsync
# SyncApp Settings
# USER=syncapp
CONF=/etc/btsync.conf
BIN=/usr/sbin/btsync
PID=/var/run/btsync/btsync.pid

Comments

Anonymous said…
And should you enjoy both taking part in} playing cards 1xbet korea in a reside poker site and taking part in} classic on line casino games, then Ignition is probably the best online on line casino for you. No bonus code is critical for this 150% deposit match as much as} $3,000 for poker and on line casino games. Bizzo Casino is one of the|is among the|is doubtless one of the} high online on line casino sites for Canadian gamers. Their clear and fashionable design makes it easy to navigate via the varied games, from slots to desk games to reside supplier sport options. Slots.lv is a unbelievable online on line casino appropriate for gamers of all styles and sizes.

Popular posts from this blog

Kviknet and IPv6

Apple IOS cannot download song

Apple AirPort Express and Digital Jitter..