updated on Wed Jan 25 20:08:56 UTC 2012
[aur-mirror.git] / veth / vethd.rc
blobd282608055ba482ea20b8ebb04dd1cf921b63b85
1 #!/bin/bash
3 # source application-specific settings
4 [ -f /etc/conf.d/vethd ] && . /etc/conf.d/vethd
6 . /etc/rc.conf
7 . /etc/rc.d/functions
9 PID=`pidof /usr/bin/vethd`
10 case "$1" in
11 start)
12 stat_busy "Starting vethd"
13 if [ -z "$PID" ]; then
14 /usr/bin/vethd $VETHD_ARGS >/dev/null &
15 PID=`pidof /usr/bin/vethd`
16 if [ -z "$PID" ]; then
17 stat_fail
18 else
19 add_daemon vethd
20 stat_done
22 else
23 stat_fail
26 stop)
27 stat_busy "Stopping vethd"
28 [ ! -z "$PID" ] && kill $PID &> /dev/null
29 if [ $? -gt 0 ]; then
30 stat_fail
31 else
32 rm_daemon vethd
33 stat_done
36 restart)
37 $0 stop
38 sleep 1
39 $0 start
42 echo "usage: $0 {start|stop|restart}"
43 esac
44 exit 0