X-Git-Url: http://git.onelab.eu/?p=myops.git;a=blobdiff_plain;f=web%2Fcollect%2Fclient%2Fupdate.sh;h=29a51fe483bd9912ed2d06698f0a44dbb37180de;hp=47016ffc98818a2a2afe6030acf0111a02f8cd20;hb=3ebc599db4bc491de0dd4195b2e6dc858dbd3d22;hpb=9bb5213371c2a3075adaed95d0e1e6ef5a58e7d6 diff --git a/web/collect/client/update.sh b/web/collect/client/update.sh index 47016ff..29a51fe 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/myops_cacert.pem ] ; then + CURL_ARGS="$CURL_ARGS --cacert /usr/boot/myops_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