summaryrefslogtreecommitdiff
path: root/social/tinc/tincd.rcd
diff options
context:
space:
mode:
Diffstat (limited to 'social/tinc/tincd.rcd')
-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