Check status for ACCESS_DENIED

pull/45/head
Gavin Hill 2022-06-20 08:08:43 +02:00
parent ca3cc077d6
commit feefa4129e
1 changed files with 8 additions and 6 deletions

View File

@ -15,9 +15,13 @@ function file_content {
while read -r; do while read -r; do
network=($REPLY) network=($REPLY)
echo " \"${network[2]}\": {" echo " \"${network[2]}\": {"
echo " \"status\":\"${network[5]}\"," if [ ${network[4]} = "ACCESS_DENIED" ]; then
echo " \"device\":\"${network[7]}\"" echo " \"status\":\"${network[4]}\","
echo " \"device\":\"${network[6]}\""
else
echo " \"status\":\"${network[5]}\","
echo " \"device\":\"${network[7]}\""
fi
if [ "$counter" -eq "$network_count" ]; then if [ "$counter" -eq "$network_count" ]; then
echo " }" echo " }"
else else
@ -38,6 +42,4 @@ fi
file_content > $FACT_FILE file_content > $FACT_FILE
# TODO: Handle statuses other than OK and ACCESS_DENIED
# TO-DO
# Handle different states than "OK". Other statuses can mess up positions.