Author: hummen Date: Fri Oct 9 18:40:24 2009 New Revision: 1084 Log: added pk-handling and further instructions to autoupdate mechanism Modified: trunk/tools/autoupdater.sh Modified: trunk/tools/autoupdater.sh ============================================================================== --- trunk/tools/autoupdater.sh Fri Oct 9 17:59:13 2009 (r1083) +++ trunk/tools/autoupdater.sh Fri Oct 9 18:40:24 2009 (r1084) @@ -9,6 +9,7 @@ #Set your LuFG username here USER="root" SERVER="morpheus.informatik.rwth-aachen.de" +PK="" # these need trailing / REMOTE_DIR="" REMOTE_HIPL_DIR=$REMOTE_DIR"hipl--midauth2--2.6/" @@ -16,6 +17,7 @@ LOCAL_DIR=$HOME"/pisa_testbed/" HIPL_FILES="hipd/hipd tools/hipconf" +#TODO add required conf-files PISA_FILES="pisacd/pisacd pisasd/pisasd pisabeacon/pisabeacon tools/msleep" PISA_FILES=$PISA_FILES" tools/switch-ip tools/trigger-hipupdate.sh" @@ -24,6 +26,7 @@ REMOTE_PATH="" REMOTE_FILES="" +PK_OPTION="" echo echo "autoupdater for hipl and pisa binaries/configs" @@ -35,21 +38,15 @@ if [ "$USER" = "" ]; then echo "Enter user name for server "$SERVER":" read USER - echo "NOTE: You can statically set the user name in this script." + echo "NOTE: You can statically set the user name in this script." fi -# Read password -echo "Enter password for "$USER"@"$SERVER":" -stty -echo -read PASS -stty echo - REMOTE_PATH=$USER"@"$SERVER":" # Create required directory structure if [ ! -d "$LOCAL_DIR" ]; then - echo "Directory $LOCAL_DIR does not exist. Creating directory."; - mkdir $LOCAL_DIR + echo "Directory $LOCAL_DIR does not exist. Creating directory."; + mkdir $LOCAL_DIR fi for FILE in $HIPL_FILES @@ -62,20 +59,32 @@ REMOTE_FILES=$REMOTE_PATH$REMOTE_PISA_DIR$FILE" "$REMOTE_FILES done -# Get files -# FIXME not sure if authentication works like this at all and even if it does, -# we should still use PK authentication instead -echo $PASS | scp $REMOTE_FILES $LOCAL_DIR +# check for ssh public key +if [ "$PK" = "" ] || [ ! -e "$HOME/.ssh/$PK" ]; then + echo "No public key found. This will be a real pain in the a**!!!" +else + echo "public key found: "$PK; + PK_OPTION="-i "$PK +fi +# Get files +#scp $PK_OPTION $REMOTE_FILES $LOCAL_DIR # Further instructions echo "done." echo echo "Make sure that you have the correct HIPL settings in [/usr/local]/etc/hosts and \ -[/usr/local]/etc/hip/hosts. Also ensure your PISA setting in "$LOCAL_DIR"pisacd.conf \ +[/usr/local]/etc/hip/hosts. Also ensure your PISA settings in "$LOCAL_DIR"pisa*d.conf \ correspond to your needs." echo echo "Then run the following commands:" -echo "1.) HIPL:" $LOCAL_DIR"hipd/hipd -k" -echo "2.1) PISA Client:" $LOCAL_DIR"pisacd -f "$LOCAL_DIR"pisacd.conf" -echo "2.2) PISA Server:" $LOCAL_DIR"pisasd" +echo "- Client" +echo "1) HIPL:" $LOCAL_DIR"hipd/hipd -kb" +echo "2) PISA Client:" $LOCAL_DIR"pisacd -f "$LOCAL_DIR"pisacd.conf" +echo "3) PISA Beacon: ./pisabeacon -lb -s "$LOCAL_DIR"trigger-hipupdate.sh" +echo "4) Roaming: ./switchip arp-only (first time: without option)" +echo "- Access Point" +echo "1) PISA Beacon: ./pisabeacon -d 192.168.8.255 -g #GEO-ID# -b" +echo "- Server" +echo "1) HIPL:" $LOCAL_DIR"hipd/hipd -kb" +echo "2) PISA Server:" $LOCAL_DIR"pisasd"