# thanks to JoelKatz, Morpher, Stefan and everyone else who has helped # me maintain this script set novice off # NOL == Number of "Hub to Hub" connections on a line ^assign NOL 6 ^assign -ALLLINKS ^assign hubs dragon skypoint igc mis phoenix ^assign leafs davis services heretic megasoft armidale igc-user glass cin usd uncc toronto xgw groucho liberator rutgers mindijari ohana eval ^assign servers $hubs $leafs ON ^364 * { if ([$1]!=[$2]){^assign alllinks $alllinks $left($index(. $1) $1) $left($index(. $2) $2) } } ON ^365 * { netstat } alias netstat { # ^assign -leafsdavis2 # ^assign -leafsvoyager # ^assign -leafszhaneel ^assign -leafsskypoint ^assign -leafsigc ^assign -leafsmis ^assign -leafsphoenix # Take a look at the next line... was missing... ^assign -leafsdragon ^assign -missing ^assign hhl 0 ^assign ixa 0 ^assign ixaend 0 ^assign lhs $word(${ixa} $alllinks) ^assign rhs $word(${ixa+1} $alllinks) ^assign lhub $match($lhs $hubs) ^assign rhub $match($rhs $hubs) while (ixaend==0) { if (lhub==0) { #LHS is NOT a legal hub, thus must be a leaf if (rhs==[mis] ) { ^assign leafsmis $leafsmis $lhs } if (rhs==[phoenix] ) { ^assign leafsphoenix $leafsphoenix $lhs } # if (rhs==[davis-2]) # { # ### Leaf is being hubbed off dragon # ^assign leafsdavis2 $leafsdavis2 $lhs # } if (rhs==[dragon]) { ### Leaf is being hubbed off dragon ^assign leafsdragon $leafsdragon $lhs } if (rhs==[igc]) { ^assign leafsigc $leafsigc $lhs } if (rhs==[skypoint]) { ### Leaf is being hubbed off skypoint ^assign leafsskypoint $leafsskypoint $lhs } #if (rhs==[voyager]) #{ #^assign leafsvoyager $leafsvoyager $lhs #} #if (rhs==[zhaneel]) #{ ### Leaf is being hubbed off skypoint #^assign leafszhaneel $leafszhaneel $lhs #} } if (rhub==0) { ###RHS is a leaf if (lhs==[mis]) { ^assign leafsmis $leafsmis $rhs } if (lhs==[phoenix]) { ^assign leafsphoenix $leafsphoenix $rhs } if (lhs==[igc]) { ^assign leafsigc $leafsigc $rhs } #if (lhs==[davis-2]) #{ ### Leaf is being hubbed off dragon #^assign leafsdavis2 $leafsdavis2 $rhs #} if (lhs==[dragon]) { ### Leaf is being hubbed off dragon ^assign leafsdragon $leafsdragon $rhs } if (lhs==[skypoint]) { ### Leaf is being hubbed off skypoint ^assign leafsskypoint $leafsskypoint $rhs } #if (lhs==[voyager]) #{ ### Leaf is being hubbed off dragon #^assign leafsvoyager $leafsvoyager $rhs #} #if (lhs==[zhaneel]) #{ ### Leaf is being hubbed off skypoint #^assign leafszhaneel $leafszhaneel $rhs #} } if (lhub!=0 && rhub!=0) { ### Hub to Hub Link ^assign hublinkl.${hhl} $lhs ^assign hublinkr.${hhl} $rhs ^assign hhl ${hhl+1} } ^assign ixa ${ixa+2} ^assign -lhs ^assign -rhs ^assign lhs $word(${ixa} $alllinks) ^assign rhs $word(${ixa+1} $alllinks) ^assign lhub $match($lhs $hubs) ^assign rhub $match($rhs $hubs) if (lhs==[]) { ^assign ixaend 1} } ^assign ixb 0 ^assign ixbend 0 ^assign chksvr $word(${ixb} $servers) ^assign svrhere $match($chksvr $alllinks) while (ixbend==0) { if (svrhere<1) { ^assign missing $missing $chksvr } ^assign ixb ${ixb+1} ^assign -chksvr ^assign chksvr $word(${ixb} $servers) ^assign svrhere $match($chksvr $alllinks) if (chksvr==[]) { ^assign ixbend 1 } } # echo Leafs hubbed off davis: # echo $[10] $LEAFSDAVIS # echo Leafs hubbed off skypoint: # echo $[10] $LEAFSSKYPOINT # echo Leafs hubbed off igc: # echo $[10] $LEAFSIGC # echo Lefas hubbed off mindijari: # echo $[10] $LEAFSMINDI # echo Leafs hubbed off phoenix: # echo $[10] $LEAFSPHOENIX # echo $[3] a davis-2: $LEAFSDavis2 echo $[4] a dragon: $LEAFSDragon echo $[7] a igc: $LEAFSIGC echo $[7] a mis: $LEAFSMIs echo $[3] a phoenix: $LEAFSPHOENIX echo $[2] a skypoint: $LEAFSSKYPOINT # echo $[3] a voyager: $LEAFSvoyager # echo $[3] a zhaneel: $LEAFSzhaneel echo echo Hub to Hub Links: @ counter = 1 @ totalcounter = 1 ^assign -tmphublist foreach hublinkl thl { if (thl NOL) || (totalcounter > hhl)) { echo $tmphublist @ counter = 1 ^assign -tmphublist } } echo echo Missing Servers: echo $[10] $missing echo eval echo You are on server: $left($index(. $S) $S) } ALIAS links { ^assign -alllinks //LINKS } echo *** Loaded Links Commander Version 1.1 (modified 5/11/96)