1
0
mirror of synced 2024-06-08 05:37:53 +02:00
TheChymera-overlay/net-p2p/btsync/files/init.d/btsync
Horea Christian 2e123ca6e5
net-p2p/btsync: added config and service files from pigfoot
Package-Manager: portage-2.2.26
2016-01-13 19:22:57 +01:00

45 lines
1.0 KiB
Plaintext

#!/sbin/runscript
# Copyright 2013-2014 Jonathan Vasquez <jvasquez1011@gmail.com>
# Distributed under the terms of the GNU General Public License v2
NAME="BitTorrent Sync"
SYNC_NAME="btsync"
SYNC_PATH="/opt/${SYNC_NAME}/"
SYNC_BINARY="${SYNC_PATH}/${SYNC_NAME}"
SYNC_OPTS="--nodaemon --config /etc/${SYNC_NAME}/btsync.conf"
SYNC_PIDFILE="/var/run/${SYNC_NAME}/${SYNC_NAME}.pid"
SYNC_USER=${SYNC_USER:-btsync}
SYNC_GROUP=${SYNC_GROUP:-btsync}
start() {
ebegin "Starting ${NAME}"
# Sets the umask for the process so that btsync creates files
# with group write permissions
start-stop-daemon --start --exec "${SYNC_BINARY}" \
--pidfile "${SYNC_PIDFILE}" --background \
--user "${SYNC_USER}" --group "${SYNC_GROUP}" \
-- ${SYNC_OPTS}
eend $?
}
stop() {
ebegin "Stopping ${NAME}"
start-stop-daemon --stop --exec "${SYNC_BINARY}" \
--pidfile "${SYNC_PIDFILE}"
eend $?
}
reload() {
ebegin "Reloading ${NAME}"
start-stop-daemon --signal HUP --exec "${SYNC_BINARY}" \
--pidfile "${SYNC_PIDFILE}"
eend $?
}