fixrmtab.in revision 1.1.1.2
1#!/bin/sh 2# 3# Invalidate /etc/rmtab entries for hosts named. 4# Restart mountd for changes to take effect. 5# 6# usage: fixrmtab host1 host2 ... 7# 8# Package: am-utils-6.x 9# Author: Andreas Stolcke <stolcke@icsi.berkeley.edu> 10 11#set -x 12 13# allow user to pass RMTAB file name from environment 14if test -z "${RMTAB}" ; then 15 RMTAB=/etc/rmtab 16fi 17 18if [ ! -f "$RMTAB" ]; then 19 exit 0 20fi 21 22TMP="$(mktemp ${RMTAB}.XXXXXX)" 23if [ -z "$TMP" ]; then 24 exit 1 25fi 26 27trap "rm -f $TMP" 0 1 2 3 15 28 29for host 30do 31 sed -e "/^$host:/s/^./#/" "$RMTAB" > "$TMP" && cp "$TMP" "$RMTAB" 32done 33