diff options
author | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2012-09-14 19:23:23 -0300 |
---|---|---|
committer | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2012-09-14 19:23:23 -0300 |
commit | f9e0f79bdd41d822c22688513f68e30ebb4d4003 (patch) | |
tree | 943f7d1d640eb704ad9378218b63d8df0709375d /social/aiccu/aiccu.rc.d | |
parent | 979e8ace3c1a32e06c1f7a2c88b9c698d36dd364 (diff) | |
download | abslibre-f9e0f79bdd41d822c22688513f68e30ebb4d4003.tar.gz abslibre-f9e0f79bdd41d822c22688513f68e30ebb4d4003.tar.bz2 abslibre-f9e0f79bdd41d822c22688513f68e30ebb4d4003.zip |
AICCU - Automatic IPv6 Connectivity Client Utility
Diffstat (limited to 'social/aiccu/aiccu.rc.d')
-rw-r--r-- | social/aiccu/aiccu.rc.d | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/social/aiccu/aiccu.rc.d b/social/aiccu/aiccu.rc.d new file mode 100644 index 000000000..b0ca08fce --- /dev/null +++ b/social/aiccu/aiccu.rc.d @@ -0,0 +1,60 @@ +#!/bin/bash + +daemon_name=aiccu + +. /etc/rc.conf +. /etc/rc.d/functions + +get_pid() { + pidof $daemon_name +} + +case "$1" in + start) + stat_busy "Starting $daemon_name daemon" + + PID=`get_pid` + if [ -z "$PID" ]; then + [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid + # RUN + $daemon_name start > /dev/null + # + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + echo `get_pid` > /var/run/$daemon_name.pid + add_daemon $daemon_name + stat_done + fi + else + stat_fail + exit 1 + fi + ;; + + stop) + stat_busy "Stopping $daemon_name daemon" + PID=`get_pid` + # RUN + $daemon_name stop + # + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + rm -f /var/run/$daemon_name.pid &> /dev/null + rm_daemon $daemon_name + stat_done + fi + ;; + + restart) + $0 stop + sleep 3 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 |