X-Git-Url: http://git.onelab.eu/?p=myops.git;a=blobdiff_plain;f=web%2Fcollect%2Fclient%2Fupdate.sh;h=59298b1007b6fe4ab3e14c52a715b0e9470d8bbc;hp=47016ffc98818a2a2afe6030acf0111a02f8cd20;hb=bccc4741c3264bc2d8c47c7ab06eb691fb3a8582;hpb=9bb5213371c2a3075adaed95d0e1e6ef5a58e7d6 diff --git a/web/collect/client/update.sh b/web/collect/client/update.sh index 47016ff..59298b1 100644 --- a/web/collect/client/update.sh +++ b/web/collect/client/update.sh @@ -7,7 +7,7 @@ else fi IP=IPADDR -DIR=multiops +DIR=PlanetLabConf FILE=bootstrap.tar.gz HDIR=/home/${PLC_SLICE_PREFIX}_myops @@ -23,8 +23,14 @@ else CURL_ARGS="" fi +if [ -f /usr/boot/cacert.pem ] ; then + CURL_ARGS="$CURL_ARGS --cacert /usr/boot/cacert.pem" +else + CURL_ARGS="$CURL_ARGS --insecure" +fi + # if bootstrap file has been updated -curl $CURL_ARGS -s -O --insecure https://$IP/$DIR/$FILE +curl $CURL_ARGS -s -O https://$IP/$DIR/$FILE if [ -f $FILE ] ; then mod_time_after=`stat -c %Y $FILE` @@ -36,6 +42,7 @@ if [[ $mod_time_after -gt $mod_time_before ]] ; then # then an update occurred, and we need to unpack it. tar -xzf $FILE chmod 755 ./*.sh ./*.py - ./bootstrap.sh + ./bootstrap.sh || exit 1 + touch $HDIR/update_ok fi