1998-11-14 03:11:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Invalidate /etc/rmtab entries for hosts named.
|
|
|
|
# Restart mountd for changes to take effect.
|
|
|
|
#
|
|
|
|
# usage: fixrmtab host1 host2 ...
|
|
|
|
#
|
2007-12-05 15:48:03 +00:00
|
|
|
# Package: am-utils-6.x
|
1998-11-14 03:11:37 +00:00
|
|
|
# Author: Andreas Stolcke <stolcke@icsi.berkeley.edu>
|
|
|
|
|
|
|
|
#set -x
|
|
|
|
|
2016-08-31 00:08:49 +00:00
|
|
|
# allow user to pass RMTAB file name from environment
|
|
|
|
if test -z "${RMTAB}" ; then
|
|
|
|
RMTAB=/etc/rmtab
|
|
|
|
fi
|
1998-11-14 03:11:37 +00:00
|
|
|
|
2016-08-31 00:08:49 +00:00
|
|
|
if [ ! -f "$RMTAB" ]; then
|
1998-11-14 03:11:37 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2016-08-31 00:08:49 +00:00
|
|
|
TMP="$(mktemp ${RMTAB}.XXXXXX)"
|
|
|
|
if [ -z "$TMP" ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
trap "rm -f $TMP" 0 1 2 3 15
|
|
|
|
|
|
|
|
for host
|
1998-11-14 03:11:37 +00:00
|
|
|
do
|
2016-08-31 00:08:49 +00:00
|
|
|
sed -e "/^$host:/s/^./#/" "$RMTAB" > "$TMP" && cp "$TMP" "$RMTAB"
|
1998-11-14 03:11:37 +00:00
|
|
|
done
|