Added simplified ConfFile entry using myops_setup_sh
[myops.git] / web / collect / client / update.sh
index 47016ff..59298b1 100644 (file)
@@ -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