summaryrefslogtreecommitdiff
path: root/social/tinc
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2012-01-05 16:12:34 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2012-01-05 16:12:34 -0300
commit9f6b0e3307f40a6115482338178e41c52c8cc072 (patch)
tree62616aba6f26e37c587b67b3507be7a20dc990d4 /social/tinc
parent6550e3926da7432dd8287740ddc488e37ece05c4 (diff)
Rebuilds and minor changes
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