Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check status for ACCESS_DENIED #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Check status for ACCESS_DENIED
  • Loading branch information
beerygaz committed Jun 20, 2022
commit feefa4129e47105ba5fc6a8e85481eaeae87ac4f
14 changes: 8 additions & 6 deletions files/set_facts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ function file_content {
while read -r; do
network=($REPLY)
echo " \"${network[2]}\": {"
echo " \"status\":\"${network[5]}\","
echo " \"device\":\"${network[7]}\""

if [ ${network[4]} = "ACCESS_DENIED" ]; then
echo " \"status\":\"${network[4]}\","
echo " \"device\":\"${network[6]}\""
else
echo " \"status\":\"${network[5]}\","
echo " \"device\":\"${network[7]}\""
fi
if [ "$counter" -eq "$network_count" ]; then
echo " }"
else
Expand All @@ -38,6 +42,4 @@ fi

file_content > $FACT_FILE


# TO-DO
# Handle different states than "OK". Other statuses can mess up positions.
# TODO: Handle statuses other than OK and ACCESS_DENIED