File: fixrmtab.in

package info (click to toggle)
am-utils 6.0.7-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,728 kB
  • ctags: 8,542
  • sloc: ansic: 34,563; sh: 9,665; perl: 2,424; makefile: 776; lex: 454; yacc: 375
file content (24 lines) | stat: -rwxr-xr-x 404 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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