X-Git-Url: http://git.onelab.eu/?p=myops.git;a=blobdiff_plain;f=web%2Fcollect%2Fclient%2Fcollect.sh;h=f8131b88ee77d5632ad43bed28b33b3e7ea3cbd5;hp=5bbc108cff91f9ead5249e6db6918eef876b10da;hb=3ebc599db4bc491de0dd4195b2e6dc858dbd3d22;hpb=85070b3d456667f238051af1a2f1f2a0c12300ab diff --git a/web/collect/client/collect.sh b/web/collect/client/collect.sh index 5bbc108..f8131b8 100644 --- a/web/collect/client/collect.sh +++ b/web/collect/client/collect.sh @@ -9,6 +9,12 @@ LOGFILE=/home/${PLC_SLICE_PREFIX}_myops/myops.log cd /home/${PLC_SLICE_PREFIX}_myops +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 + # TODO: add a timeout to eval, that kills children after X seconds function write_key_command () { @@ -22,7 +28,7 @@ function write_key_value () key=$1 value=$2 ( - flock -s 200 + flock -x -w 240 200 2> /dev/null echo $key : $value >> $LOGFILE ) 200>/var/lock/myops } @@ -42,7 +48,7 @@ while read key colon command ; do fi fi fi -done < <( curl --silent http://IPADDR/PlanetLabConf/input.cfg ) +done < <( curl $CURL_ARGS -s https://IPADDR/PlanetLabConf/input.cfg ) write_key_value "count" "$count"