diff options
author | Joshua Ismael Haase Hernández <hahj87@gmail.com> | 2011-07-07 21:41:42 -0500 |
---|---|---|
committer | Joshua Ismael Haase Hernández <hahj87@gmail.com> | 2011-07-07 21:41:42 -0500 |
commit | a385416a6942ab9609019b97b8a8aa3068b6812e (patch) | |
tree | cc55f608327aa7640c12e3220116fb24564cf780 /social/tinc/tincd.rcd | |
parent | e99a90fb121148ecfdd29c63446c42474c4e2433 (diff) | |
parent | f4b22150c67a332d15bbbf322ab34066b0dfafb6 (diff) |
Merge branch 'master' of vparabola:~/projects/abslibre
Conflicts:
libre/libretools/PKGBUILD
Diffstat (limited to 'social/tinc/tincd.rcd')
-rw-r--r-- | social/tinc/tincd.rcd | 43 |
1 files changed, 43 insertions, 0 deletions
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 |