updated on Sat Jan 14 12:12:45 UTC 2012
[aur-mirror.git] / ike / ike.rc.d
blobc034d5a83f45c2cfcb2fab9381645dcd61c82db0
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`pidof -o %PPID /usr/sbin/iked`
8 case $1 in
10 start)
11 if [[ -z $PID ]] && /usr/sbin/iked; then
12 stat_busy 'Starting IKE daemon'
13 PID=`pidof -o %PPID /usr/sbin/iked`
14 add_daemon iked
15 stat_done
16 else
17 stat_fail
18 exit 1
22 stop)
23 stat_busy 'Stopping IKE daemon'
24 if [[ -n $PID ]] && kill $PID &>/dev/null; then
25 rm_daemon iked
26 stat_done
27 else
28 stat_fail
29 exit 1
33 restart)
34 $0 stop
35 $0 start
39 echo "Usage: $0 {start|stop|restart}" >&2
40 exit 1
43 esac