wok annotate autofs/stuff/etc/init.d/autofs @ rev 20081
palemoon update to 27.5.0 (Sep 26)
author | Erkan Yilmaz <erkan@slitaz.org> |
---|---|
date | Wed Sep 27 17:56:03 2017 +0000 (2017-09-27) |
parents | a6137e640e01 |
children | 6f4496f6c83c |
rev | line source |
---|---|
pascal@7323 | 1 #!/bin/sh |
al@19159 | 2 # /etc/init.d/autofs : Start, stop and restart automounter on SliTaz, at |
pascal@7323 | 3 # boot time or with the command line. |
pascal@7323 | 4 # |
pascal@7323 | 5 # To start automounter at boot time, just put dropbear in the $RUN_DAEMONS |
pascal@7323 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf |
pascal@7323 | 7 # |
pascal@7323 | 8 . /etc/init.d/rc.functions |
pascal@7323 | 9 . /etc/daemons.conf |
pascal@7323 | 10 |
pascal@7323 | 11 NAME=Automount |
al@19159 | 12 DESC="$(_ '%s server' Automount)" |
pascal@7323 | 13 DAEMON=/usr/sbin/automount |
pascal@7323 | 14 OPTIONS=$AUTOMOUNT_OPTIONS |
pascal@7323 | 15 PIDFILE=/var/run/automount.pid |
pascal@7323 | 16 |
pascal@7323 | 17 case "$1" in |
pascal@7323 | 18 start) |
pascal@7323 | 19 if active_pidfile $PIDFILE automount ; then |
al@19159 | 20 _ '%s is already running.' $NAME |
pascal@7323 | 21 exit 1 |
pascal@7323 | 22 fi |
al@19159 | 23 action 'Starting %s: %s...' "$DESC" $NAME |
pascal@7323 | 24 modprobe autofs4 |
pascal@7323 | 25 $DAEMON $OPTIONS |
pascal@7323 | 26 status |
pascal@7323 | 27 ;; |
pascal@7323 | 28 stop) |
pascal@7323 | 29 if ! active_pidfile $PIDFILE automount ; then |
al@19159 | 30 _ '%s is not running.' $NAME |
pascal@7323 | 31 exit 1 |
pascal@7323 | 32 fi |
al@19159 | 33 action 'Stopping %s: %s...' "$DESC" $NAME |
al@19159 | 34 kill $(cat $PIDFILE) |
pascal@7323 | 35 rmmod autofs4 |
pascal@7323 | 36 status |
pascal@7323 | 37 ;; |
pascal@7323 | 38 restart) |
pascal@7323 | 39 if ! active_pidfile $PIDFILE automount ; then |
al@19159 | 40 _ '%s is not running.' $NAME |
pascal@7323 | 41 exit 1 |
pascal@7323 | 42 fi |
al@19159 | 43 action 'Restarting %s: %s...' "$DESC" $NAME |
al@19159 | 44 kill $(cat $PIDFILE) |
pascal@7323 | 45 sleep 2 |
pascal@7323 | 46 $DAEMON $OPTIONS |
pascal@7323 | 47 status |
pascal@7323 | 48 ;; |
pascal@7323 | 49 *) |
al@19159 | 50 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" |
al@19159 | 51 newline |
pascal@7323 | 52 exit 1 |
pascal@7323 | 53 ;; |
pascal@7323 | 54 esac |
pascal@7323 | 55 |
pascal@7323 | 56 exit 0 |