Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site kitc.UUCP Path: utzoo!watmath!clyde!cbosgd!cbdkc1!desoto!packard!hoxna!houxm!whuxl!whuxlm!spuxll!kitc!ladm From: ladm@kitc.UUCP (John Burgess - Local tools ADM) Newsgroups: net.sources Subject: MkMapData.sh Message-ID: <175@kitc.UUCP> Date: Mon, 26-Aug-85 13:29:08 EDT Article-I.D.: kitc.175 Posted: Mon Aug 26 13:29:08 1985 Date-Received: Wed, 28-Aug-85 20:29:12 EDT Distribution: net Organization: /usr/local/null Lines: 62 # this is NOT a SHAR - see article posted to net.news,net.mail # for info about this shell. # also watch for .signature at end! # --- cut here --- # shell to generate uucpmap source information for local machine # usage: MkMapData [ 'new' ] [ 2-digit-month ] # new - regenerates entire list from uuname # month - overrides current month analysis cd /usr/spool/uucpmap TMP=/tmp/mkmap$$ cp MapData OLDMapData if [ "$1" = new ] then # initial list comes from uuname; assume erratic connection # throw out local systems; convert to canonical UUCP format # (all lower case, max 6 char names) uuname | egrep -v 'LOCAL SYSTEMS' | tr "[A-Z]" "[a-z]" | sort | sed -e '/^\(......\)..*$/s//\1/' \ -e 's/^.*$/ &(WEEKLY),/' >${TMP} ed - MapData <<-EOF /^`uname` /+;/^\$/-d -r ${TMP} s/,// w EOF shift fi # generate modifications based on recent experience # don't replace unusual entries (those with '+', '-', etc.) # use g/.../ so that it can't fail now=${1-`date +%m`} uustat -mall | grep " $now/" | sed -n -e 's/ .* / /' \ -e '/LOCAL SYSTEMS/d' \ -e 's@\(.*\) BAD SYSTEM@g/ \1(/s/([A-Z]*)/(DEAD)/@p' \ -e 's@\(.*\) CONVERSATION SUCCEEDED@g/ \1(/s/([A-Z]*)/(DEMAND)/@p' \ -e 's@\(.*\) [A-Z]* FAILED@g/ \1(/s/([A-Z]*)/(DEAD)/@p' \ >${TMP} echo 'w' >>${TMP} # apply uustat modifications; then "local wisdom" overrides. ed - MapData <${TMP} ed - MapData <<-EOF g/LOCAL SYSTEMS/s/DEMAND/DIRECT/ /ihnp4/s/+*L*O*W*)/+LOW)/ w EOF # if running from terminal, report changes test -t 1 && diff OLDMapData MapData rm ${TMP} -- John Burgess - Local Tools Administrator ATT-IS Labs, So. Plainfield NJ (HP 1C-221) {most Action Central sites}!kitc!ladm (201) 561-7100 x2481 (8-259-2481)