changes for new build process
[pingofdeath.git] / pl-podzap
1 #! /bin/bash
2 Invocation="pl-podzap TargetHostName"
3 # Fetches the hash code from the saved hash code file and commands
4 # the specified PlanetLab node to send
5 # the properly constructed ICMP message to the remote node to
6 # reset it.
7 # -----------------------------------------------------------------
8 # $Header: /shareddata/CVS/planetlab/admin/ipod/pl-podzap,v 1.4 2003/01/18 01:43:48 radams Exp $
9 #
10 # Copyright (c) 2003 Intel Corporation
11 # All rights reserved.
12 # This file is distributed under the terms in the attached INTEL_LICENSE
13 # file.  If you do not find this file, a copy can be obtained by
14 # writing to Intel Research Berkeley; Attention: Intel License Inquiry;
15 # 2150 Shattuck Avenue, suite 1300; Berkeley, CA 94704
16 # -----------------------------------------------------------------
17
18 TARGETIP=$1
19
20 if [[ x$TARGETIP == x ]] ; then
21     echo "Invocation: $Invocation"
22     exit 1
23 fi
24
25 PLBIN="/usr/local/planetlab/bin"
26 HASHFILE="./HashFile"
27
28 set `grep "$TARGETIP" $HASHFILE`
29 DATEE=$1
30 HOSTIP=$2
31 TARGETIPP=$3
32 HASHCODE=$4
33
34 if [[ x$HASHCODE != x ]] ; then
35     echo "DATEE=$DATEE, HOSTIP=$HOSTIP, TARGETIPP=$TARGETIPP, HASHCODE = '$HASHCODE'"
36
37     ssh idsl1@$HOSTIP "echo $HASHCODE | sudo $PLBIN/pl-poddoit -i - $TARGETIP"
38 else
39     echo "No hash code found for specified target node"
40 fi
41