3 if [ -f /etc/planetlab/plc_config ]; then
4 source /etc/planetlab/plc_config
8 LOGFILE=/home/${PLC_SLICE_PREFIX}_myops/myops.log
10 cd /home/${PLC_SLICE_PREFIX}_myops
12 if [ -f /usr/boot/cacert.pem ] ; then
13 CURL_ARGS="$CURL_ARGS --cacert /usr/boot/cacert.pem"
15 CURL_ARGS="$CURL_ARGS --insecure"
18 # TODO: add a timeout to eval, that kills children after X seconds
19 function write_key_command ()
24 write_key_value "$key" "$value"
26 function write_key_value ()
31 flock -x -w 240 200 2> /dev/null
32 echo $key : $value >> $LOGFILE
39 while read key colon command ; do
40 if [[ $colon = ":" ]] ; then
41 write_key_command "$key" "$command" &
42 count=$(( $count + 1 ))
44 if [[ $colon = ":=" ]] ; then
45 eval $key=`eval $command`
46 else if [[ $colon = "()" ]] ; then
47 eval "function $key () $command"
51 done < <( curl $CURL_ARGS -s https://IPADDR/PlanetLabConf/input.cfg )
53 write_key_value "count" "$count"