Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 332ff98c authored by Antoine Blanquet's avatar Antoine Blanquet
Browse files

Passive Active Bug Fixed if file doesn't exisst at start (with Keving Y)

parent af917337
......@@ -46,26 +46,27 @@ do
done
#On stock les ids des devices d'hier
ids_2=$(jq --raw-output ".result[] | .id" ${DATA_DEV_FOLDER}.last_devices_states.json)
id_2=()
i=0
for ID in $ids_2
do
id_2[$i]=$ID
i=$((i+1))
done
#On stock les states des devices d'hier
full_state=$(jq --raw-output ".result[] | .lastState" ${DATA_DEV_FOLDER}.last_devices_states.json)
states_2=()
j=0
for s in $full_state
do
state_2[$j]=$s
j=$((j+1))
done
if [ -f "${DATA_DEV_FOLDER}.last_devices_states.json" ]; then
#On stock les ids des devices d'hier
ids_2=$(jq --raw-output ".result[] | .id" ${DATA_DEV_FOLDER}.last_devices_states.json)
id_2=()
i=0
for ID in $ids_2
do
id_2[$i]=$ID
i=$((i+1))
done
#On stock les states des devices d'hier
full_state=$(jq --raw-output ".result[] | .lastState" ${DATA_DEV_FOLDER}.last_devices_states.json)
states_2=()
j=0
for s in $full_state
do
state_2[$j]=$s
j=$((j+1))
done
fi
#On compare les states des devices d'aujourd'hui et hier
for (( i=0; i<${#id[@]}; i++ ))
......
......@@ -45,26 +45,27 @@ do
fi
done
#We store yesterday gateways ids
ids_2=$(jq --raw-output ".result[] | .id" ${DATA_GAT_FOLDER}.last_gateways_states.json)
id_2=()
i=0
for ID in $ids_2
do
id_2[$i]=$ID
i=$((i+1))
done
#We store yesterday gateways states
full_state=$(jq --raw-output ".result[] | .lastState" ${DATA_GAT_FOLDER}.last_gateways_states.json)
states_2=()
j=0
for s in $full_state
do
state_2[$j]=$s
j=$((j+1))
done
if [ -f "${DATA_GAT_FOLDER}.last_gateways_states.json" ]; then
#We store yesterday gateways ids
ids_2=$(jq --raw-output ".result[] | .id" ${DATA_GAT_FOLDER}.last_gateways_states.json)
id_2=()
i=0
for ID in $ids_2
do
id_2[$i]=$ID
i=$((i+1))
done
#We store yesterday gateways states
full_state=$(jq --raw-output ".result[] | .lastState" ${DATA_GAT_FOLDER}.last_gateways_states.json)
states_2=()
j=0
for s in $full_state
do
state_2[$j]=$s
j=$((j+1))
done
fi
#We compare today and yesterday gateways states
for (( i=0; i<${#id[@]}; i++ ))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment