updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / t6_client / t6_client.rc.d
blob191d3cdd39a0ff0ac2a63ed97d0b65b5131d94f6
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`pidof %PPID /usr/sbin/t6_client`
7 case "$1" in
8 start)
9 stat_busy "Starting tunnel6 client"
10 if [ -z "$PID" ]; then
11 /usr/sbin/t6_client -d
13 if [ -n "$PID" -o $? -ne 0 ]; then
14 stat_fail
15 else
16 add_daemon t6_client
17 stat_done
20 stop)
21 stat_busy "Stopping tunnel6 client"
22 [ -n "$PID" ] && kill $PID &>/dev/null
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 rm_daemon t6_client
27 stat_done
30 restart)
31 $0 stop
32 sleep 1
33 $0 start
36 echo "usage: $0 {start|stop|restart}"
37 esac