wok view autofs/stuff/etc/init.d/autofs @ rev 25037

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