summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authormanu <manu@pkgsrc.org>2015-09-30 13:18:27 +0000
committermanu <manu@pkgsrc.org>2015-09-30 13:18:27 +0000
commit315f1f28388811ab8161d5ef9df8fdcb42f53d4e (patch)
treeedf4d12366821a9455d2e6bbce9ddc779da78470 /net
parent76075552a3ef447863076120657e429c9593d86b (diff)
downloadpkgsrc-315f1f28388811ab8161d5ef9df8fdcb42f53d4e.tar.gz
Missing file from initial package import
Thanks to wiz@ for pointing it out;
Diffstat (limited to 'net')
-rwxr-xr-xnet/syncffsd/files/syncffsd.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/net/syncffsd/files/syncffsd.sh b/net/syncffsd/files/syncffsd.sh
new file mode 100755
index 00000000000..3069030efc4
--- /dev/null
+++ b/net/syncffsd/files/syncffsd.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+
+# PROVIDE: syncffsd
+# REQUIRE: LOGIN
+
+$_rc_subr_loaded . /etc/rc.subr
+
+name="syncffsd"
+rcvar=$name
+pidfile="@VARBASE@/run/syncffsd/${name}.pid"
+command="@PREFIX@/sbin/syncffsd"
+
+start_precmd=syncffsd_precmd
+start_cmd=syncffsd_start
+
+syncffsd_precmd() {
+ local userflag
+
+ if [ "x${syncffsd_user}" != "x" ] ; then
+ userflag="-o ${syncffsd_user}"
+ fi
+
+ install -d -m 755 ${userflag} `dirname ${pidfile}`
+}
+syncffsd_start() {
+ local userflag
+
+ if [ -n "$rc_pid" ]; then
+ echo 1>&2 "${name} already running? (pid=$rc_pid)."
+ exit 1
+ fi
+
+ if [ "x${syncffsd_src}" = "x" ] ; then
+ echo 1>&2 "syncffsd_src is not defined in rc.conf"
+ exit 1
+ fi
+
+ if [ "x${syncffsd_dst}" = "x" ] ; then
+ echo 1>&2 "syncffsd_dst is not defined in rc.conf"
+ exit 1
+ fi
+
+ if [ "x${syncffsd_user}" != "x" ] ; then
+ userflag="-u ${syncffsd_user}"
+ fi
+
+ echo "Starting ${name}."
+ ${command} -p ${pidfile} ${userflag} ${syncffsd_src} ${syncffsd_dst}
+}
+
+load_rc_config $name
+run_rc_command "$1"