Lines 31-43
Link Here
|
31 |
-a x`echo "$map" | cut -c1` != 'x-' ] |
31 |
-a x`echo "$map" | cut -c1` != 'x-' ] |
32 |
then |
32 |
then |
33 |
map=`echo "/etc/$map" | sed -e 's:^/etc//:/:'` |
33 |
map=`echo "/etc/$map" | sed -e 's:^/etc//:/:'` |
34 |
options=`echo "$options" | sed -e 's/\(^\|[ \t]\)-/\1/g'` |
34 |
timeout=`echo $options | sed --silent -e 's/\(.*\)\(--timeout=[0-9]\+\)\(.*\)/\2/g ; /--timeout=[0-9]\+/ p'` |
|
|
35 |
options=`echo $options | sed -e 's/\(.*\)\(--timeout=[0-9]\+\)\(.*\)/\1\3/g ; s/\(^\|[ \t]\)-/\1/g'` |
35 |
if [ -x $map ]; then |
36 |
if [ -x $map ]; then |
36 |
echo "/usr/sbin/automount $dir program $map $options $localoptions" |
37 |
echo "/usr/sbin/automount $timeout $dir program $map $options $localoptions" |
37 |
elif [ -f $map ]; then |
38 |
elif [ -f $map ]; then |
38 |
echo "/usr/sbin/automount $dir file $map $options $localoptions" |
39 |
echo "/usr/sbin/automount $timeout $dir file $map $options $localoptions" |
39 |
else |
40 |
else |
40 |
echo "/usr/sbin/automount $dir `basename $map` $options $localoptions" |
41 |
echo "/usr/sbin/automount $timeout $dir `basename $map` $options $localoptions" |
41 |
fi |
42 |
fi |
42 |
fi |
43 |
fi |
43 |
done |
44 |
done |
Lines 63-69
Link Here
|
63 |
options=`echo "$options" | sed -e ' |
64 |
options=`echo "$options" | sed -e ' |
64 |
s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g |
65 |
s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g |
65 |
s/\(^\|[ \t]\)-/\1/g'` |
66 |
s/\(^\|[ \t]\)-/\1/g'` |
66 |
echo "/usr/sbin/automount $dir yp $map $options $localoptions" |
67 |
echo "/usr/sbin/automount $mountoptions $dir yp $map $options $localoptions" |
67 |
fi |
68 |
fi |
68 |
done |
69 |
done |
69 |
) |
70 |
) |
Lines 72-88
Link Here
|
72 |
|
73 |
|
73 |
start() { |
74 |
start() { |
74 |
ebegin "Starting automounter" |
75 |
ebegin "Starting automounter" |
75 |
getmounts | while read cmd mnt rest |
76 |
getmounts | while read cmd timeout mnt rest |
76 |
do |
77 |
do |
|
|
78 |
#FIXME: this works but it really sucks |
79 |
if echo $timeout|grep -v -- '--timeout' >/dev/null ; then |
80 |
rest="$mnt $rest" |
81 |
mnt="$timeout" |
82 |
timeout="" |
83 |
fi |
84 |
|
77 |
echo -n " $mnt" |
85 |
echo -n " $mnt" |
78 |
pidfile=/var/run/autofs`echo $mnt | sed 's/\//./'`.pid |
86 |
pidfile=/var/run/autofs`echo $mnt | sed 's/\//./'`.pid |
79 |
start-stop-daemon --start --pidfile $pidfile --quiet \ |
87 |
start-stop-daemon --start --pidfile $pidfile --quiet \ |
80 |
--exec /usr/sbin/automount -- $mnt $rest |
88 |
--exec /usr/sbin/automount -- $timeout $mnt $rest |
81 |
# |
89 |
# |
82 |
# Automount needs a '--pidfile' or '-p' option. |
90 |
# Automount needs a '--pidfile' or '-p' option. |
83 |
# For now we look for the pid ourself. |
91 |
# For now we look for the pid ourself. |
84 |
# |
92 |
# |
85 |
ps ax | grep "[0-9]:[0-9][0-9] /usr/sbin/automount $mnt" | ( |
93 |
ps ax | grep "[0-9]:[0-9][0-9] /usr/sbin/automount $timeout \?$mnt" | ( |
86 |
read pid rest |
94 |
read pid rest |
87 |
echo $pid > $pidfile |
95 |
echo $pid > $pidfile |
88 |
echo "$mnt $rest" >> $pidfile |
96 |
echo "$mnt $rest" >> $pidfile |