Commit bcc77d22 authored by Kevin Yung's avatar Kevin Yung
Browse files

correction d'erreur sur les changements de states des gateways

parent 33dfbece
{"jwt":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjaGlycHN0YWNrLWFwcGxpY2F0aW9uLXNlcnZlciIsImV4cCI6MTYxNTM4NzM2NCwiaXNzIjoiY2hpcnBzdGFjay1hcHBsaWNhdGlvbi1zZXJ2ZXIiLCJuYmYiOjE2MTUzMDA5NjQsInN1YiI6InVzZXIiLCJ1c2VybmFtZSI6IkNoaXJwc3RhY2tNb25pdG9yaW5nIn0.H5mO2AL35i-0BK4YBTZTZ_5MHDKqq-7c7HPqexnKQOU"} {"jwt":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjaGlycHN0YWNrLWFwcGxpY2F0aW9uLXNlcnZlciIsImV4cCI6MTYxNTkxMDIxMiwiaXNzIjoiY2hpcnBzdGFjay1hcHBsaWNhdGlvbi1zZXJ2ZXIiLCJuYmYiOjE2MTU4MjM4MTIsInN1YiI6InVzZXIiLCJ1c2VybmFtZSI6IkNoaXJwc3RhY2tNb25pdG9yaW5nIn0.WMcgbg-Mi4QecWM-MkZ4WImwycGyHuH2Rvqj1tXsGPo"}
\ No newline at end of file \ No newline at end of file
...@@ -81,9 +81,11 @@ do ...@@ -81,9 +81,11 @@ do
then then
if [[ "${state[$i]}" == "active" ]] if [[ "${state[$i]}" == "active" ]]
then then
replacement="<li style="color:green"><a href='https://lns.campusiot.imag.fr/#/organizations/6/gateways/7276ff0039030716'>7276ff0039030716</a>: KER_FEMTO_030716_P307 - (org 6) - 2021-03-07T19:14:43.804084Z</li>" tmp=$(grep ${id[$i]} < .gateways.html)
replacement=${tmp/"<li>"/"<li style="color:green">"}
else else
replacement="<li style="color:red"><a href='https://lns.campusiot.imag.fr/#/organizations/6/gateways/7276ff0039030716'>7276ff0039030716</a>: KER_FEMTO_030716_P307 - (org 6) - 2021-03-07T19:14:43.804084Z</li>" tmp=$(grep ${id[$i]} < .gateways.html)
replacement=${tmp/"<li>"/"<li style="color:red">"}
fi fi
sed -i "/${id[$i]}/c $replacement" .gateways.html sed -i "/${id[$i]}/c $replacement" .gateways.html
fi fi
......
...@@ -15,5 +15,5 @@ CONTENT_TYPE="Content-type: text/html" ...@@ -15,5 +15,5 @@ CONTENT_TYPE="Content-type: text/html"
#mail -a "$CONTENT_TYPE" -s "$SUBJECT" -u monitoring $TO <.gateways.html #mail -a "$CONTENT_TYPE" -s "$SUBJECT" -u monitoring $TO <.gateways.html
#mail -a "$CONTENT_TYPE" -s "$SUBJECT" -u monitoring $TO <.devices.html #mail -a "$CONTENT_TYPE" -s "$SUBJECT" -u monitoring $TO <.devices.html
#mailx -a "$CONTENT_TYPE" -s "$SUBJECT" <.gateways.html "$TO" mailx -a "$CONTENT_TYPE" -s "$SUBJECT" <.gateways.html "$TO"
mail -s "Test" kevyung24@gmail.com #mail -s "Test" kevyung24@gmail.com
\ No newline at end of file \ No newline at end of file
Supports Markdown
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