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 c603f7b8 authored by Paul Lambert's avatar Paul Lambert
Browse files

translated to english french comments

parent 40065e75
......@@ -14,7 +14,7 @@
# Parameters
if [[ $# -eq 0 ]]; then
echo "Aucun arguments renseignées : Usage: $0 GATEWAYS_LENGTH GATEWAYS TODAY"
echo "No arguments : Usage: $0 GATEWAYS_LENGTH GATEWAYS TODAY"
exit 1
fi
......@@ -26,7 +26,7 @@ if [[ $# -ne args_len ]]; then
exit 1
fi
GATEWAYS=${@:2:$GATEWAYS_LENGTH} # on recupère les données de la gateway passés en paramètre en subsituant la taille et la date du jour.
GATEWAYS=${@:2:$GATEWAYS_LENGTH} # We get data from the gateway which is passed in parameter and we are replacing the length and date time
TODAY="${@:$#}" # last parameter
# gateways_to_html : Step 1 : Generate header.
......
......@@ -3,7 +3,7 @@
#TODAY="2021-03-02"
TODAY="$(date +"%Y-%m-%d")"
#On stock les ids des gateways d'aujourd'hui
#We store gateways' ids of the present day
ids=$(jq --raw-output ".result[] | .id" .gateways.json)
id=()
i=0
......@@ -13,7 +13,7 @@ do
i=$((i+1))
done
#On stock les dates de dernière activité des gateways d'aujourd'hui
#We store dates from the last activity of the gateways from today
dates=$(jq --raw-output ".result[] | .lastSeenAt" .gateways.json)
date=()
date=($dates)
......@@ -37,8 +37,7 @@ do
done
#On stock les states des gateways d'aujourd'hui dans un tableau en regardant la date
#de dernière activité des gateways
#We store states from today gateways in an array by looking at last activity dates
for (( i=0; i<${#d[@]}; i++ ))
do
if [[ "${d[$i]}" == "$TODAY" ]]
......@@ -49,7 +48,7 @@ do
fi
done
#On stock les ids des gateways d'hier
#We store yesterday gateways ids
ids_2=$(jq --raw-output ".result[] | .id" lastGatewaysStates.json)
id_2=()
i=0
......@@ -59,7 +58,7 @@ do
i=$((i+1))
done
#On stock les states des gateways d'hier
#We store yesterday gateways states
full_state=$(jq --raw-output ".result[] | .lastState" lastGatewaysStates.json)
states_2=()
j=0
......@@ -70,7 +69,7 @@ do
done
#On compare les states des gateways d'aujourd'hui et hier
#We compare today and yesterday gateways states
for (( i=0; i<${#id[@]}; i++ ))
do
for (( j=0; j<${#id_2[@]}; j++ ))
......@@ -100,7 +99,7 @@ do
fi
done
#On met à jour les states des gateways pour le prochain jour
#We update gateways state for the next day
echo "{
\"totalCount\": \"${#id[@]}\",
\"result\": [" > lastGatewaysStates.json
......
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