From 4f72d84c329d227609bcc426ca3651136bfa7ae8 Mon Sep 17 00:00:00 2001 From: Nicolás Reynolds Date: Sun, 26 Jun 2011 17:41:46 -0300 Subject: social/tinc-1.0.15-2 Includes daemon script --- social/tinc/tincd.rcd | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 social/tinc/tincd.rcd (limited to 'social/tinc/tincd.rcd') diff --git a/social/tinc/tincd.rcd b/social/tinc/tincd.rcd new file mode 100644 index 000000000..f0a456e17 --- /dev/null +++ b/social/tinc/tincd.rcd @@ -0,0 +1,43 @@ +#!/bin/bash + +daemon_name=tincd + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/$daemon_name.conf + +PID=`pidof -o %PPID /usr/sbin/tincd` + +case "$1" in + start) + stat_busy "Starting ${daemon_name}" + [ -z "$PID" ] && \ + /usr/sbin/tincd -n ${NETNAME} \ + --pidfile=/var/run/tinc.${NETNAME} &> /dev/null + + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon ${daemon_name} + stat_done + fi + ;; + stop) + stat_busy "Stopping ${daemon_name}" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon ${daemon_name} + stat_done + fi + ;; + restart) + $0 stop + sleep 3 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 -- cgit v1.2.3