summaryrefslogtreecommitdiff
path: root/social/tinc
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-01-05 23:14:48 +0000
committerroot <root@rshg054.dnsready.net>2012-01-05 23:14:48 +0000
commit817e58c278cb8ebee7743205877d0f67c431fcec (patch)
treef2716cc059272be15ea4691e8d40e6a998f4c936 /social/tinc
parent85828cc2c2c3ef5c0b9b03388b9323d3d163b389 (diff)
Thu Jan 5 23:14:48 UTC 2012
Diffstat (limited to 'social/tinc')
-rw-r--r--social/tinc/tincd.rcd14
1 files changed, 9 insertions, 5 deletions
diff --git a/social/tinc/tincd.rcd b/social/tinc/tincd.rcd
index d790ef86f..16f39f8ca 100644
--- a/social/tinc/tincd.rcd
+++ b/social/tinc/tincd.rcd
@@ -4,9 +4,10 @@ daemon_name=tincd
. /etc/rc.conf
. /etc/rc.d/functions
-. /etc/conf.d/$daemon_name.conf
+. /etc/conf.d/${daemon_name}.conf
-PID=`pidof -o %PPID /usr/sbin/tincd`
+PIDFILE=/var/run/tinc.${NETNAME}
+[ -f "${PIDFILE}" ] && PID=$(<${PIDFILE})
case "$1" in
start)
@@ -14,7 +15,7 @@ case "$1" in
[ -z "$PID" ] && \
/usr/sbin/tincd -n ${NETNAME} \
${OPTIONS} \
- --pidfile=/var/run/tinc.${NETNAME} &> /dev/null
+ --pidfile=${PIDFILE} &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
@@ -25,7 +26,7 @@ case "$1" in
;;
stop)
stat_busy "Stopping ${daemon_name}"
- [ ! -z "$PID" ] && kill $PID &> /dev/null
+ [ ! -z "$PID" ] && /usr/sbin/tincd -n ${NETNAME} -k
if [ $? -gt 0 ]; then
stat_fail
else
@@ -38,7 +39,10 @@ case "$1" in
sleep 3
$0 start
;;
+ reload)
+ [ ! -z "$PID" ] && /usr/sbin/tincd -n ${NETNAME} -k HUP
+ ;;
*)
- echo "usage: $0 {start|stop|restart}"
+ echo "usage: $0 {start|stop|restart|reload}"
esac
exit 0