Skip to content

Commit

Permalink
Minor update for LUAmisc method
Browse files Browse the repository at this point in the history
  • Loading branch information
jhubig committed Dec 27, 2023
1 parent 53e9998 commit 0725289
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fritzBoxShell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -342,20 +342,20 @@ LUAmisc(){
# - not working on all machines - maybe linked to different jq versions - Works with 1.7 but not with 1.5 and 1.6
# totalConnectionsWLAN=$(wget -O - --post-data "xhr=1&sid=$SID&page=overview&xhrId=first&noMenuRef=1" "http://$BoxIP/data.lua" 2>/dev/null | jq '.data.net.devices.[] | select(.type=="wlan" ) | length' | wc -l)

totalConnectionsWLAN2G=$(echo $overview | grep -ow '"desc":"2,4 GHz"' | wc -l)
totalConnectionsWLAN5G=$(echo $overview | grep -ow '"desc":"5 GHz"' | wc -l)
totalConnectionsWLANguest=$(echo $overview | grep -ow '"guest":true,"online"' | wc -l)
totalConnectionsWLAN2G=$(grep -ow '"desc":"2,4 GHz"' <<< $overview | wc -l)
totalConnectionsWLAN5G=$(grep -ow '"desc":"5 GHz"' <<< $overview | wc -l)
totalConnectionsWLANguest=$(grep -ow '"guest":true,"online"' <<< $overview | wc -l)
echo "2,4G WLAN: $totalConnectionsWLAN2G"
echo "5G WLAN: $totalConnectionsWLAN5G"
echo "Guest WLAN: $totalConnectionsWLANguest"
elif [ "$option2" == "totalConnectionsWLAN2G" ]; then
totalConnectionsWLAN2G=$(echo $overview | grep -ow '"desc":"2,4 GHz"' | wc -l)
totalConnectionsWLAN2G=$(grep -ow '"desc":"2,4 GHz"' <<< $overview | wc -l)
echo $totalConnectionsWLAN2G
elif [ "$option2" == "totalConnectionsWLAN5G" ]; then
totalConnectionsWLAN5G=$(echo $overview | grep -ow '"desc":"5 GHz"' | wc -l)
totalConnectionsWLAN5G=$(grep -ow '"desc":"5 GHz"' <<< $overview | wc -l)
echo $totalConnectionsWLAN5G
elif [ "$option2" == "totalConnectionsWLANguest" ]; then
totalConnectionsWLANguest=$(echo $overview | grep -ow '"guest":true,"online"' | wc -l)
totalConnectionsWLANguest=$(grep -ow '"guest":true,"online"' <<< $overview | wc -l)
echo $totalConnectionsWLANguest
elif [ "$option2" == "totalConnectionsLAN" ]; then
# - not working on all machines - maybe linked to different jq versions - Works with 1.7 but not with 1.5 and 1.6
Expand Down

0 comments on commit 0725289

Please sign in to comment.