summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-p2p/resilio-sync/files/resilio-sync-user.initd')
-rw-r--r--net-p2p/resilio-sync/files/resilio-sync-user.initd27
1 files changed, 27 insertions, 0 deletions
diff --git a/net-p2p/resilio-sync/files/resilio-sync-user.initd b/net-p2p/resilio-sync/files/resilio-sync-user.initd
new file mode 100644
index 000000000000..efcaa2d7778c
--- /dev/null
+++ b/net-p2p/resilio-sync/files/resilio-sync-user.initd
@@ -0,0 +1,27 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+USER="${RC_SVCNAME##*.}"
+command="/usr/bin/rslsync"
+name="Resilio Sync for $USER"
+description="Resilio Sync"
+command_user="${USER:-rslsync}:${GROUP:-rslsync}"
+pidfile="${PIDFILE:-/home/$USER/.config/resilio-sync/resilio-sync.pid}"
+config=${CONFIG:-/home/$USER/.config/resilio-sync/config.json}
+command_args="--config $config ${OPTS}"
+start_stop_daemon_args="-q"
+retry="10"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ if [ "$USER" = "resilio-sync-user" ]; then
+ eerror "You are not supposed to run this script directly."
+ eerror "Create a symlink for this script:"
+ eerror " ln -s $RC_SVCNAME /etc/init.d/$RC_SVCNAME.<user>"
+ return 1
+ fi
+}