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 f24a78af authored by Antoine Blanquet's avatar Antoine Blanquet
Browse files

Update generate_devices_reports separating with get_devices

parent 906b582b
#!/bin/bash
# -------------------------------------------------
# Description: Generate HTML report of devices
# List Command: x
# Usage: runned by get_devices.sh
# Create by: CampusIoT Dev Team, 2021 - Copyright (C) CampusIoT, - All Rights Reserved
# -------------------------------------------------
# Milestone: Version 2021
# -------------------------------------------------
# Bug:
# -------------------------------------------------
# DATA REPOSITORY
DATA_DEV_FOLDER="data/devices/"
DATA_HTML_FOLDER="data/generated_files/"
devices_html="${DATA_HTML_FOLDER}.devices.html"
echo '<html><head><title>CampusIoT LNS :: Devices</title></head><body style="font-family:verdana;"><h1>CampusIoT LNS :: Devices</h1>' > ${devices_html}
TODAY=$(date +"%Y-%m-%d")
echo '<p>generated at ' >> ${devices_html}
date +"%Y-%m-%d %T %Z" >> ${devices_html}
echo ' - ' >> ${devices_html}
TZ=GMT date +"%Y-%m-%d %T %Z" >> ${devices_html}
echo '</p>' >> ${devices_html}
echo '<h2>Active devices</h2>' >> ${devices_html}
jq --raw-output -f devices_to_html.jq ${DATA_DEV_FOLDER}.devices.json | grep $TODAY >> ${devices_html}
echo '<h2>Passive devices</h2>' >> ${devices_html}
jq --raw-output -f devices_to_html.jq ${DATA_DEV_FOLDER}.devices.json | grep -v $TODAY >> ${devices_html}
echo '</body></html>' >> ${devices_html}
\ No newline at end of file
......@@ -6,7 +6,7 @@
# Usage: runned by get_gateways.sh
# Create by: CampusIoT Dev Team, 2021 - Copyright (C) CampusIoT, - All Rights Reserved
# -------------------------------------------------
# Version: 1.0
# Milestone: Version 2021
# -------------------------------------------------
# Bug:
# -------------------------------------------------
......
......@@ -104,26 +104,10 @@ sed -i "/"totalCount"/c $replacement" ${DATA_DEV_FOLDER}.devices.json
# --header "$AUTH" ${URL}'/api/devices?limit=9999&offset=0' \
# > .devices.json
echo "generate devices.html"
./generate_devices_report.sh $TODAY
echo '<html><head><title>CampusIoT LNS :: Devices</title></head><body style="font-family:verdana;"><h1>CampusIoT LNS :: Devices</h1>' > ${devices_html}
TODAY=$(date +"%Y-%m-%d")
echo '<p>generated at ' >> ${devices_html}
date +"%Y-%m-%d %T %Z" >> ${devices_html}
echo ' - ' >> ${devices_html}
TZ=GMT date +"%Y-%m-%d %T %Z" >> ${devices_html}
echo '</p>' >> ${devices_html}
echo '<h2>Active devices</h2>' >> ${devices_html}
jq --raw-output -f devices_to_html.jq ${DATA_DEV_FOLDER}.devices.json | grep $TODAY >> ${devices_html}
echo '<h2>Passive devices</h2>' >> ${devices_html}
jq --raw-output -f devices_to_html.jq ${DATA_DEV_FOLDER}.devices.json | grep -v $TODAY >> ${devices_html}
echo '</body></html>' >> ${devices_html}
./get_id_devices_change.sh
......
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