#!/bin/ksh ## ## SCRIPT: exports_sgia ## Where: in $FEDIR/scripts where $FEDIR=/apps/nns_com/fea ## ############################################################################# ## PURPOSE: Shows exports from 'sgia' on the SGI network, ## sorted by directory name. ## Uses '/etc/exports' list on sgia. ## ############################################################################# ## CALLED BY: hosts_on_sgia.menu which is called by ## feamain/feahelpg OR ## feamain/feautils.menu/hostvu.menu OR ## feamain/feautils.menu/netvu.menu ## ############################################################################# ## MAINTENANCE HISTORY: ## Written by: B. Montandon 24Jun1997 ## Updated by: B. Montandon 16Nov2000 Update for sgia -> engprd00. ############################################################################# ############### # . $FEDIR/scripts/clearnns # # echo "\ # ........................................................................... # SHOW/PRINT *COMPLETE,CURRENT* LIST OF EXPORTED FILE SYSTEMS from # the SGI File Server on the NNS Engineering IRIX network # " ############### ############################################################################# ## SET TEMP-LIST-FILENAME IN $OUTLIST. ############################################################################# . $FEDIR/scripts/set_localoutlist ############################################################################# ## PREP REPORT HEADING. ############################################################################# THISHOST=`hostname` SERVER="engprd00" echo "\ ***************************** `date '+%Y %b %d %a %T%p %Z'` ***************** SHOW/PRINT *COMPLETE & CURRENT* LIST OF EXPORTED FILE SYSTEMS from the SGI FILE SERVER ( $SERVER ) on the NNS Engineering IRIX network (Sorted by directory name.) .............................................................................. " > $OUTLIST ############################################################################# ## PREP REPORT CONTENTS. ############################################################################# ### SORTSTR="+0 -1" ## SORTSTR="-t. +0n -1 +1n -2 +2n -3 +3n -4" SORTSTR="-k1" ## cat /etc/exports | sort -t: +0 -n | cut -d: -f1,3,4,5,6,7 >> $OUTLIST ## cat /etc/exports | sort $SORTSTR >> $OUTLIST ## cat /etc/exports | awk '{print $1 "\t" $2 }' | sort $SORTSTR >> $OUTLIST ## cat /etc/exports | awk '{printf "%-20s %s ", $1 , $2; print "" }' | sort $SORTSTR >> $OUTLIST echo "+ $USER" > $HOME/.rhosts ## FOR TESTING: # set -x rsh $SERVER cat /etc/exports | grep -v "^#" | sort $SORTSTR | \ awk '{printf "%-20s \n %s \n \n", $1 , $2 }' \ >> $OUTLIST ## FOR TESTING: # set - ############################################################################# ## ADD A TRAILER TO THE REPORT. ############################################################################# echo " ...................................................................... The list above was generated by script $0 run from Host $THISHOST Command used ON SERVER $SERVER: cat /etc/exports | grep -v "^#" | sort $SORTSTR | \\ awk '{printf \"%-20s \\\n %s \\\n \\\n \", \$1 , \$2 }' This report can be generated via a 'mailtools' toolchest option, or via old nnsFEAmenu option 'h a1 3' OR 'u h hi 3' OR 'u n hi 3'. ...................................................................... " >> $OUTLIST ############################################################################# ## SHOW REPORT FILE. ############################################################################# # . $FEDIR/scripts/shofil $OUTLIST (may fail to pass $1 if not down a shell) $FEDIR/scripts/shofil $OUTLIST