updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / autofs-eyemzpatched / autofs
blob08bd3e133e2df81ec86e53868355aa2e810bfa91
1 #!/bin/bash
3 daemon_name=autofs
5 . /etc/rc.conf
6 . /etc/rc.d/functions
8 # source application-specific settings
9 [ -f /etc/conf.d/autofs ] && . /etc/conf.d/autofs
11 if [ ! -z "$TIMEOUT" ]; then
12 daemonoptions="--timeout=$TIMEOUT $daemonoptions"
15 PID=`cat /var/run/autofs-running 2> /dev/null`
16 case "$1" in
17 start)
18 stat_busy "Starting $daemon_name daemon"
19 [ -z "$PID" ] && /usr/sbin/automount $daemonoptions &> /dev/null
20 if [ $? -gt 0 ]; then
21 stat_fail
22 else
23 add_daemon $daemon_name
24 stat_done
27 stop)
28 stat_busy "Stopping $daemon_name daemon"
29 [ ! -z "$PID" ] && kill $PID &> /dev/null
30 if [ $? -gt 0 ]; then
31 stat_fail
32 else
33 rm_daemon $daemon_name
34 stat_done
37 restart)
38 stat_busy "Restarting $daemon_name daemon"
39 $0 stop
40 sleep 1
41 $0 start
43 status)
44 stat_busy "Checking $daemon_name status";
45 ck_status $daemon_name
48 echo "usage: $0 {start|stop|restart|status}"
49 esac
50 exit 0