|
|
1.1 ! root 1: #!/bin/sh ! 2: # ! 3: # set up a variable to create individual file names with ! 4: # ! 5: who=`whoami` ! 6: # ! 7: # save current working directory ! 8: # ! 9: savdir=`pwd` ! 10: # ! 11: # make sure we are in our home directory ! 12: # ! 13: chdir /1a/ether/${who} ! 14: echo ! 15: echo "** Execute the 'rwho' command to show who is **" ! 16: echo "** currently logged in to the network. **" ! 17: echo ! 18: echo "rwho -a" ! 19: rwho -a ! 20: echo ! 21: echo "** Execute the 'ruptime' command to show the usage on **" ! 22: echo "** the systems. **" ! 23: echo ! 24: echo "/usr/ucb/ruptime -a" ! 25: /usr/ucb/ruptime -a ! 26: echo ! 27: echo "** Execute the 'nstat' command to show configured **" ! 28: echo "** systems in the network. **" ! 29: echo ! 30: echo "/etc/nstat -i" ! 31: /etc/nstat -i ! 32: sleep 10 ! 33: echo ! 34: echo "** Copy the files /atp/ether and /etc/termcap **" ! 35: echo "** to the remote computer. **" ! 36: echo ! 37: echo "rcp /atp/ether $remote:/1a/ether/${who}/${who}_ether.cp" ! 38: rcp /atp/ether $remote:/1a/ether/${who}/${who}_ether.cp ! 39: if (test $? -ne 0) ! 40: then ! 41: echo ! 42: echo " ##### Remote copy command failed. Check #####" ! 43: echo " ##### cabling connections and/or hard- #####" ! 44: echo " ##### ware configuration for errors. #####" ! 45: echo ! 46: echo " ##### ATP Failed #####" ! 47: echo ! 48: echo "1" > /1a/ether/${who}/${who}_stat ! 49: else ! 50: echo "rcp /etc/termcap $remote:/1a/ether/${who}/${who}_etc_term.cp" ! 51: rcp /etc/termcap $remote:/1a/ether/${who}/${who}_etc_term.cp ! 52: if (test $? -ne 0) ! 53: then ! 54: echo ! 55: echo " ##### Remote copy command failed. Check #####" ! 56: echo " ##### cabling connections and/or hard- #####" ! 57: echo " ##### ware configuration for errors. #####" ! 58: echo ! 59: echo " ##### ATP Failed #####" ! 60: echo ! 61: echo "1" > /1a/ether/${who}/${who}_stat ! 62: else ! 63: echo ! 64: echo "** List the $remote /1a/ether/${who} directory to show **" ! 65: echo "** that we copied /atp/ether and /etc/termcap from the **" ! 66: echo "** host computer into /1a/ether/${who}. **" ! 67: echo ! 68: echo "rsh $remote ls -lg /1a/ether/${who}" ! 69: echo ! 70: rsh $remote ls -lg /1a/ether/${who} ! 71: if (test $? -ne 0) ! 72: then ! 73: echo ! 74: echo "##### Unable to list directory. Check #####" ! 75: echo "##### to see if it exists. #####" ! 76: echo ! 77: echo "##### ATP Failed #####" ! 78: echo ! 79: echo "1" > /1a/ether/${who}/${who}_stat ! 80: else ! 81: echo ! 82: sleep 10 ! 83: echo "** Copy the remote files we just created **" ! 84: echo "** back into the local computer. **" ! 85: echo ! 86: echo "rcp $remote:/1a/ether/${who}/${who}_ether.cp /1a/ether/${who}/${who}_ether.cp" ! 87: rcp $remote:/1a/ether/${who}/${who}_ether.cp /1a/ether/${who}/${who}_ether.cp ! 88: if (test $? -ne 0) ! 89: then ! 90: echo ! 91: echo "##### Remote copy command failed. Check #####" ! 92: echo "##### to see if remote files exist. #####" ! 93: echo ! 94: echo "##### ATP Failed #####" ! 95: echo ! 96: echo "1" > /1a/ether/${who}/${who}_stat ! 97: else ! 98: echo "rcp $remote:/1a/ether/${who}/${who}_etc_term.cp /1a/ether/${who}/${who}_etc_term.cp" ! 99: rcp $remote:/1a/ether/${who}/${who}_etc_term.cp /1a/ether/${who}/${who}_etc_term.cp ! 100: if (test $? -ne 0) ! 101: then ! 102: echo ! 103: echo "##### Remote copy command failed. Check #####" ! 104: echo "##### to see if remote files exist. #####" ! 105: echo ! 106: echo "##### ATP Failed #####" ! 107: echo ! 108: echo "1" > /1a/ether/${who}/${who}_stat ! 109: else ! 110: echo ! 111: echo "** We should now see the files ${who}_ether.cp and **" ! 112: echo "** ${who}_etc_term.cp in the /1a/ether/${who} dir- **" ! 113: echo "** ectory. **" ! 114: echo ! 115: echo "ls -lg" ! 116: echo ! 117: ls -lg ! 118: if (test $? -ne 0) ! 119: then ! 120: echo ! 121: echo " ##### Unable to list directory. Check #####" ! 122: echo " ##### to see if files were copied. #####" ! 123: echo ! 124: echo " ##### ATP Failed #####" ! 125: echo ! 126: echo "1" > /1a/ether/${who}/${who}_stat ! 127: else ! 128: echo ! 129: echo "** Create a file for in the remote system for **" ! 130: echo "** manipulation later by the host system. **" ! 131: echo ! 132: echo "rsh $remote cp /etc/termcap /1a/ether/${who}/${who}_test_ether" ! 133: echo ! 134: rsh $remote cp /etc/termcap /1a/ether/${who}/${who}_test_ether ! 135: if (test $? -ne 0) ! 136: then ! 137: echo ! 138: echo "##### Unable to create file. Check to #####" ! 139: echo "##### see if '/1a/ether/${who}' dir- #####" ! 140: echo "##### ectory in the remote is intact. #####" ! 141: echo ! 142: echo "##### ATP Failed #####" ! 143: echo ! 144: echo "1" > /1a/ether/${who}/${who}_stat ! 145: else ! 146: echo "** List the /1a/ether/${who} directory to show the **" ! 147: echo "** file we created. **" ! 148: echo ! 149: echo "rsh $remote ls -lg /1a/ether/${who}" ! 150: echo ! 151: rsh $remote ls -lg /1a/ether/${who} ! 152: if (test $? -ne 0) ! 153: then ! 154: echo ! 155: echo " ##### Unable to list remote directory. #####" ! 156: echo " ##### Check to see if it is intact. #####" ! 157: echo ! 158: echo " ##### ATP Failed #####" ! 159: echo ! 160: echo "1" > /1a/ether/${who}/${who}_stat ! 161: else ! 162: sleep 10 ! 163: echo ! 164: echo "** Do a 'diff' on files /atp/ether and **" ! 165: echo "** /1a/ether/${who}/${who}_ether.cp. There **" ! 166: echo "** should not be any differences printed. **" ! 167: echo ! 168: echo "diff /atp/ether /1a/ether/${who}/${who}_ether.cp" ! 169: diff /atp/ether /1a/ether/${who}/${who}_ether.cp ! 170: if (test $? -ne 0) ! 171: then ! 172: echo ! 173: echo " ##### There are differences in the files. #####" ! 174: echo " ##### Data integrity compromised during #####" ! 175: echo " ##### transfer or file not transferred. #####" ! 176: echo ! 177: echo " ##### ATP Failed #####" ! 178: echo ! 179: echo "1" > /1a/ether/${who}/${who}_stat ! 180: else ! 181: echo ! 182: echo "** Do a 'diff' on files /etc/termcap and **" ! 183: echo "** /1a/ether/${who}/${who}_etc_term.cp. **" ! 184: echo "** There should not be any differences **" ! 185: echo "** printed. **" ! 186: echo ! 187: echo "diff /etc/termcap /1a/ether/${who}/${who}_etc_term.cp" ! 188: diff /etc/termcap /1a/ether/${who}/${who}_etc_term.cp ! 189: if (test $? -ne 0) ! 190: then ! 191: echo ! 192: echo " ##### There are differences in the files. #####" ! 193: echo " ##### Data integrity compromised during #####" ! 194: echo " ##### transfer or file not transferred. #####" ! 195: echo ! 196: echo " ##### ATP Failed #####" ! 197: echo ! 198: echo "1" > /1a/ether/${who}/${who}_stat ! 199: else ! 200: echo ! 201: echo ! 202: echo "** Do a 'mv' command on file the we created in the remote **" ! 203: echo "** using the 'rsh' command. **" ! 204: echo ! 205: echo "rsh $remote mv ${who}_test_ether ${who}_old.test_ether" ! 206: rsh $remote mv ${who}_test_ether ${who}_old.test_ether ! 207: if (test $? -ne 0) ! 208: then ! 209: echo ! 210: echo " ##### Unable to move remote file. Check #####" ! 211: echo " ##### to see if it was created. #####" ! 212: echo ! 213: echo " ##### ATP Failed #####" ! 214: echo ! 215: echo "1" > /1a/ether/${who}/${who}_stat ! 216: else ! 217: echo ! 218: echo "** List the directory to see that we changed the name. **" ! 219: echo ! 220: echo "rsh $remote ls -lg /1a/ether/${who}" ! 221: echo ! 222: rsh $remote ls -lg /1a/ether/${who} ! 223: if (test $? -ne 0) ! 224: then ! 225: echo ! 226: echo " ##### Unable to list remote directory. #####" ! 227: echo " ##### to see if it is intact. #####" ! 228: echo ! 229: echo " ##### ATP Failed #####" ! 230: echo ! 231: echo "1" > /1a/ether/${who}/${who}_stat ! 232: else ! 233: # ! 234: # put the user back where he was before we started ! 235: # ! 236: chdir $savdir ! 237: # ! 238: # make sure the mess we made is gone ! 239: # ! 240: rsh $remote rm -f /1a/ether/${who}/${who}_old.test_ether ! 241: rm -f /1a/ether/${who}/${who}_old.test_ether ! 242: rsh $remote rm -f /1a/ether/${who}/${who}_ether.cp ! 243: rm -f /1a/ether/${who}/${who}_ether.cp ! 244: rsh $remote rm -f /1a/ether/${who}/${who}_etc_term.cp ! 245: rm -f /1a/ether/${who}/${who}_etc_term.cp ! 246: fi ! 247: fi ! 248: fi ! 249: fi ! 250: fi ! 251: fi ! 252: fi ! 253: fi ! 254: fi ! 255: fi ! 256: fi ! 257: fi
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.