X-Git-Url: http://git.onelab.eu/?p=myops.git;a=blobdiff_plain;f=web%2Fcollect%2Fclient%2Fupload.sh;h=064481cee34f2a3ac960f60d32fc5d16869feaae;hp=02b7c5eddc7b2fad0c88f985bf73899d47e1d137;hb=bccc4741c3264bc2d8c47c7ab06eb691fb3a8582;hpb=9bb5213371c2a3075adaed95d0e1e6ef5a58e7d6 diff --git a/web/collect/client/upload.sh b/web/collect/client/upload.sh index 02b7c5e..064481c 100644 --- a/web/collect/client/upload.sh +++ b/web/collect/client/upload.sh @@ -1,20 +1,15 @@ #!/bin/bash -#if [ -f /tmp/source/configuration ] ; then -# source /tmp/source/configuration -#elif [ -f /etc/planetlab/plc_config ] ; then -# source /etc/planetlab/plc_config -#else -# PLC_MONITOR_HOST=IPADDR -#fi -#if [[ -z "$PLC_MONITOR_HOST" || "$PLC_MONITOR_HOST" = "localhost.localdomain" ]] ; then -# PLC_MONITOR_HOST=monitor.planet-lab.org -#fi if [ -f /etc/planetlab/plc_config ]; then source /etc/planetlab/plc_config else PLC_SLICE_PREFIX='pl' fi +if [ -f /usr/boot/cacert.pem ] ; then + CURL_ARGS="$CURL_ARGS --cacert /usr/boot/cacert.pem" +else + CURL_ARGS="$CURL_ARGS --insecure" +fi export MYOPS_SERVER=IPADDR @@ -38,7 +33,7 @@ function upload_log () #comm -1 -3 $old $new > $log cp $new $log if [ $( stat -c %s $log ) -ne 0 ] ; then - curl --max-time 60 --silent http://${MYOPS_SERVER}/upload.php --form "log=@$log" + curl $CURL_ARGS --max-time 60 --silent https://${MYOPS_SERVER}/upload.php --form "log=@$log" if [ $? -ne 0 ] ; then # the upload has failed, so remove new file so no data is lost rm -f /tmp/$( basename $file ).new