btsync added
This commit is contained in:
12
net-p2p/btsync/files/confd
Normal file
12
net-p2p/btsync/files/confd
Normal file
@@ -0,0 +1,12 @@
|
||||
# conf.d file for btsync
|
||||
|
||||
# User and group daemon runs as
|
||||
BTSYNC_USER="btsync"
|
||||
BTSYNC_GROUP="btsync"
|
||||
|
||||
NAME="BitTorrent Sync"
|
||||
SYNC_NAME="btsync"
|
||||
SYNC_PATH="/opt/${SYNC_NAME}/"
|
||||
SYNC_BINARY="${SYNC_PATH}/${SYNC_NAME}"
|
||||
SYNC_OPTS="--config /etc/${SYNC_NAME}/config"
|
||||
SYNC_PIDFILE="/var/run/btsync/${SYNC_NAME}.pid"
|
41
net-p2p/btsync/files/initd
Normal file
41
net-p2p/btsync/files/initd
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright (C) 2013-2014 Jonathan Vasquez <fearedbliss@funtoo.org>
|
||||
# Copyright (C) 2014 Sandy McArthur <Sandy@McArthur.org>
|
||||
# Distributed under the terms of the Simplified BSD License.
|
||||
|
||||
depend() {
|
||||
need localmount net
|
||||
after bootmisc
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting ${NAME}"
|
||||
|
||||
mkdir -p $(dirname ${SYNC_PIDFILE})
|
||||
chown ${BTSYNC_USER}:${BTSYNC_GROUP} $(dirname ${SYNC_PIDFILE})
|
||||
|
||||
start-stop-daemon \
|
||||
--start \
|
||||
--user "${BTSYNC_USER}" \
|
||||
--group "${BTSYNC_GROUP}" \
|
||||
--nice 5 \
|
||||
--ionice 3 \
|
||||
--exec "${SYNC_BINARY}" \
|
||||
-- ${SYNC_OPTS}
|
||||
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping ${NAME}"
|
||||
|
||||
start-stop-daemon \
|
||||
--stop \
|
||||
--user "${BTSYNC_USER}" \
|
||||
--group "${BTSYNC_GROUP}" \
|
||||
--exec "${SYNC_BINARY}" \
|
||||
--wait 5000 \
|
||||
--retry SIGTERM/5
|
||||
|
||||
eend $?
|
||||
}
|
Reference in New Issue
Block a user