summaryrefslogtreecommitdiff
path: root/net-p2p/gift
diff options
context:
space:
mode:
authorPhilip M. Gollucci <pgollucci@FreeBSD.org>2009-12-17 23:23:52 +0000
committerPhilip M. Gollucci <pgollucci@FreeBSD.org>2009-12-17 23:23:52 +0000
commit77a4da96635547242c1913d344cad4b3812a5ef1 (patch)
treed952b63eb3bc2d26f664f2714704106e2069e23d /net-p2p/gift
parent- USE_RC_SUBR != yes (diff)
- missed a file
Notes
Notes: svn path=/head/; revision=246075
Diffstat (limited to 'net-p2p/gift')
-rw-r--r--net-p2p/gift/files/giftd.in49
1 files changed, 49 insertions, 0 deletions
diff --git a/net-p2p/gift/files/giftd.in b/net-p2p/gift/files/giftd.in
new file mode 100644
index 000000000000..c1e73c205f39
--- /dev/null
+++ b/net-p2p/gift/files/giftd.in
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: giftd
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+# Define these giftd_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/giftd
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+
+giftd_enable="${giftd_enable-NO}"
+giftd_flags="-d -q"
+# giftd_user=""
+# giftd_local_dir=""
+
+. %%RC_SUBR%%
+
+name=giftd
+rcvar=`set_rcvar`
+command=%%PREFIX%%/bin/giftd
+
+required_dirs=${giftd_local_dir}
+start_precmd=giftd_check_vars
+
+giftd_check_vars()
+{
+ if [ -z ${giftd_user} ]; then
+ giftd_user=$(whoami)
+ fi
+
+ if [ $giftd_user = 'root' ]; then
+ warn "You should set giftd_user to a non-root user for security reasons"
+ fi
+
+ if [ -z ${giftd_local_dir} ]; then
+ giftd_local_dir="$(pw usershow $giftd_user | awk -F : '{ print $9 }')/.giFT"
+ fi
+
+ rc_flags="${giftd_flags} --local-dir=${giftd_local_dir}"
+}
+
+load_rc_config $name
+run_rc_command "$1"