X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=initscripts%2Fpl_boot;h=20f44916ddf3958caf700a71663e954120f69790;hb=8b8fd00c0fb49747e4fca7cbf69a3590cb6324a0;hp=237c2b1360eeef05b8dca7aae5812c422a460e23;hpb=fbb28081184fec4f88439ba32f9003fff28eb1bb;p=bootcd.git diff --git a/initscripts/pl_boot b/initscripts/pl_boot index 237c2b1..20f4491 100755 --- a/initscripts/pl_boot +++ b/initscripts/pl_boot @@ -1,5 +1,13 @@ #!/bin/bash +### make sure this output shows up in the console + +exec 2>&1 +exec > /dev/console + +### +. /etc/init.d/pl_functions + . /tmp/planet.cnf # Run gpg once to create default options @@ -20,11 +28,11 @@ ATTEMPTS_BEFORE_BACKUP=3 BOOT_DIR=/usr/boot/ # get the server we are going to be contacting -BOOT_SERVER=`cat $BOOT_DIR/boot_server` -BOOT_SERVER_PORT=`cat $BOOT_DIR/boot_server_port` +BOOT_SERVER=$(cat $BOOT_DIR/boot_server) +BOOT_SERVER_PORT=$(cat $BOOT_DIR/boot_server_port) # the file to request from the boot server -BOOT_SERVER_PATH=`cat $BOOT_DIR/boot_server_path` +BOOT_SERVER_PATH=$(cat $BOOT_DIR/boot_server_path) # location of the cacert for this boot server BOOT_SERVER_CACERT=$BOOT_DIR/cacert.pem @@ -33,11 +41,11 @@ BOOT_SERVER_CACERT=$BOOT_DIR/cacert.pem BOOT_SERVER_GPG_KEYRING=$BOOT_DIR/pubring.gpg # get the backup server we are going to be contacting -BACKUP_BOOT_SERVER=`cat $BOOT_DIR/backup/boot_server` -BACKUP_BOOT_SERVER_PORT=`cat $BOOT_DIR/backup/boot_server_port` +BACKUP_BOOT_SERVER=$(cat $BOOT_DIR/backup/boot_server) +BACKUP_BOOT_SERVER_PORT=$(cat $BOOT_DIR/backup/boot_server_port) # the file to request from the backup boot server -BACKUP_BOOT_SERVER_PATH=`cat $BOOT_DIR/backup/boot_server_path` +BACKUP_BOOT_SERVER_PATH=$(cat $BOOT_DIR/backup/boot_server_path) # location of the cacert for the backup boot server BACKUP_BOOT_SERVER_CACERT=$BOOT_DIR/backup/cacert.pem @@ -105,14 +113,12 @@ while : ; do if [[ $contact_count != 0 ]]; then - if [[ $on_backup_server == 1 ]]; then - echo $(date "+%H:%M:%S") " pl_boot: attempting to fetch script from backup server in 30s" - else - echo $(date "+%H:%M:%S") " pl_boot: attempting to fetch script from primary server in 30s" - fi + echo $(date "+%H:%M:%S") " pl_boot: next attempt in 30s, to fetch script from server at $CONNECT_BOOT_SERVER" /bin/sleep 30 fi + # June 2015 : using --tlsv1 instead of sslv3 that should be available + # on all myplc from f14 inclusive # assemble the curl transaction CURL_CMD="/usr/bin/curl \ --connect-timeout 60 \ @@ -124,7 +130,7 @@ while : ; do --form nonce=