summaryrefslogtreecommitdiff
path: root/scripts/fixrmtab
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/fixrmtab')
-rwxr-xr-xscripts/fixrmtab24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/fixrmtab b/scripts/fixrmtab
new file mode 100755
index 000000000000..33b7bcfdb6ce
--- /dev/null
+++ b/scripts/fixrmtab
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# Invalidate /etc/rmtab entries for hosts named.
+# Restart mountd for changes to take effect.
+#
+# usage: fixrmtab host1 host2 ...
+#
+# Package: am-utils-6.0
+# Author: Andreas Stolcke <stolcke@icsi.berkeley.edu>
+
+#set -x
+
+RMTAB=/etc/rmtab
+TMP=/tmp/rmtab.$$
+
+if [ ! -f /etc/rmtab ]; then
+ exit 0
+fi
+
+for host in $*
+do
+ sed -e '/^'$host':/s/^./#/' $RMTAB > $TMP && cp $TMP $RMTAB
+done
+rm -f $TMP