X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=autofs.init;h=bd0c80e5b76b54151ca8427efb4570311b024c10;hb=6db8d2f6e1af35dbbf52d6515d0a58324ae080e1;hp=331420c2c0e385d1098dce6369ea639ea56b46a4;hpb=f897d0ea090b81f678a9c22d9ace91a48b6fb65e;p=packages%2Fautofs.git diff --git a/autofs.init b/autofs.init index 331420c..bd0c80e 100644 --- a/autofs.init +++ b/autofs.init @@ -5,8 +5,8 @@ # # chkconfig: 2345 72 08 # -# description: Script for automount using a Sun-style "master map". -# We first look for a local /etc/autofs/auto.master, then a YP +# description: Script for automount using a Sun-style "master map". \ +# We first look for a local /etc/autofs/auto.master, then a YP \ # map with that name # # processname: autofs @@ -24,7 +24,7 @@ # Check that networking is up. if is_yes "${NETWORKING}"; then - if [ ! -f /var/lock/subsys/network ]; then + if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then # nls "ERROR: Networking is down. %s can't be run." msg_network_down automounter exit 1 @@ -50,6 +50,8 @@ if [ -f /etc/autofs/auto.master ]; then while read dir map options; do if [ ! -z "$dir" -a ! -z "$map" \ -a x`echo "$map" | cut -c1` != 'x-' ]; then + maptype=`echo $map | cut -f1 -d:` + if [ "$maptype" = "$map" ]; then map=`echo "/etc/autofs/$map" | sed -e 's:^/etc\/autofs//:/:'` options=`echo "$options" | sed -e 's/\(^\|[ \t]\)-/\1/g'` if [ -x $map ]; then @@ -59,6 +61,15 @@ if [ -f /etc/autofs/auto.master ]; then else echo "$DAEMON --timeout $TIMEOUT $dir `basename $map` $options" fi + else + map=`echo $map | cut -f2- -d:` + if [ ! -z "$map" ]; then + if [ "$maptype" = "file" ]; then + map=`echo "/etc/autofs/$map" | sed -e 's:^/etc\/autofs//:/:'` + fi + echo "$DAEMON --timeout $TIMEOUT $dir $maptype $map $options" + fi + fi fi done ) @@ -111,7 +122,6 @@ case "$1" in stop) if [ -f /var/lock/subsys/autofs ]; then msg_stopping automounter - automount -TERM killproc automount rm -f /var/lock/subsys/autofs >/dev/null 2>&1 else