axis_examplecompt_changesinfo-opsversion-1.30version-2.00version-3.01version-3.02
Last change
on this file since 2ef2c5b was
63f7c7e,
checked in by Ted Faber <faber@…>, 17 years ago
|
add hosts fixup
|
-
Property mode set to
100755
|
File size:
1.6 KB
|
Rev | Line | |
---|
[61f19e0] | 1 | #!/bin/sh |
---|
| 2 | |
---|
| 3 | BOSSNODE="/usr/local/etc/emulab/bossnode" |
---|
| 4 | # GATEWAY="detertunnel" |
---|
| 5 | |
---|
[63f7c7e] | 6 | PORTS="139 7777" |
---|
| 7 | NC="/usr/bin/nc" |
---|
| 8 | RCDIR="/usr/local/etc/emulab/rc" |
---|
| 9 | |
---|
| 10 | RCACCT="rc.accounts" |
---|
| 11 | SMBMOUNT="smbmount.pl" |
---|
| 12 | |
---|
[61f19e0] | 13 | if [ -f $BOSSNODE ] |
---|
| 14 | then |
---|
| 15 | rm -f $BOSSNODE |
---|
| 16 | fi |
---|
| 17 | |
---|
| 18 | EMUDIR="/usr/local/etc/emulab/" |
---|
| 19 | |
---|
[63f7c7e] | 20 | # Find this experiment's stashed scripts. (Perl for advanced parsing) |
---|
| 21 | SCRIPTDIR=`$EMUDIR/tmcc -b status | perl -ne '/ALLOCATED=([^\/]+)\/([^\s]+)/ && print "/proj/$1/exp/$2/tmp\n";'` |
---|
[61f19e0] | 22 | |
---|
[63f7c7e] | 23 | # Die if things are weird |
---|
| 24 | if [ -z "$SCRIPTDIR" ] ; then |
---|
| 25 | echo "Can't find federation scripts. Tmcc status says:" |
---|
| 26 | $EMUDIR/tmcc -b status |
---|
| 27 | exit 1; |
---|
| 28 | fi |
---|
| 29 | |
---|
| 30 | # Move the SMB mounting script out of NFS so we can call it after the umount |
---|
| 31 | cp "$SCRIPTDIR/$SMBMOUNT" /tmp |
---|
| 32 | |
---|
| 33 | # Copy the global hostnames file into /etc/hosts so this node can address |
---|
| 34 | # others in the experiment on other testbeds. |
---|
| 35 | grep 127\\.0\\.0\\.1 /etc/hosts > /tmp/hosts |
---|
| 36 | cat "$SCRIPTDIR/hosts" >> /tmp/hosts |
---|
| 37 | cp /tmp/hosts /etc/hosts && rm /tmp/hosts |
---|
| 38 | |
---|
| 39 | GATEWAY=`$EMUDIR/tmcc -b syncserver | awk ' { match($0, /SERVER=[^[:space:]]+/); print substr($0,RSTART+8,RLENGTH-9);}'` |
---|
[61f19e0] | 40 | |
---|
| 41 | # |
---|
| 42 | # Spin on our gateway! |
---|
| 43 | # |
---|
| 44 | |
---|
| 45 | echo "Waiting for the tunnel to come online." |
---|
| 46 | |
---|
| 47 | for port in $PORTS |
---|
| 48 | do |
---|
| 49 | until $NC -z $GATEWAY $port |
---|
| 50 | do |
---|
| 51 | sleep 5 |
---|
| 52 | done |
---|
| 53 | done |
---|
| 54 | |
---|
| 55 | # |
---|
| 56 | # Setup TMCC to use our gateway |
---|
| 57 | # |
---|
| 58 | |
---|
| 59 | echo "Configuring TMCC." |
---|
| 60 | |
---|
| 61 | $EMUDIR/sethostname |
---|
| 62 | |
---|
| 63 | echo $GATEWAY > $BOSSNODE |
---|
| 64 | |
---|
[63f7c7e] | 65 | |
---|
[61f19e0] | 66 | # |
---|
| 67 | # Unmount stuff before messing with accounts |
---|
| 68 | # |
---|
| 69 | umount -A -f -t nfs,smbfs |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | # |
---|
| 73 | # Setup new accounts |
---|
| 74 | # |
---|
| 75 | $RCDIR/rc.accounts reconfig |
---|
| 76 | |
---|
| 77 | # |
---|
| 78 | # Copy and exec the smbmount perl script |
---|
| 79 | # |
---|
| 80 | |
---|
| 81 | echo "Mounting via SMB." |
---|
| 82 | |
---|
[63f7c7e] | 83 | exec "/tmp/$SMBMOUNT" |
---|
Note: See
TracBrowser
for help on using the repository browser.