#! /bin/sh #------------------------------------------------------------------------ # remove line from config file if it exists in it. removeLineFromFile() { FileName=$1 oldLine=$2 if [ ! -z "$oldLine" ] then cat $FileName | grep -v "$oldLine" > ${FileName}.tmp mv ${FileName}.tmp $FileName echo "Updated." fi } #= Main PostUn =============================================================== # Update /etc/services FileName=/etc/services oldLine=`grep "^gds_db" $FileName` removeLineFromFile "$FileName" "$oldLine"