forked from honsa/FritzBoxShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfritzBoxShellTest.sh
More file actions
31 lines (24 loc) · 1.29 KB
/
fritzBoxShellTest.sh
File metadata and controls
31 lines (24 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
#************************************************************#
#** Autor: Jürgen Key https://elbosso.github.io/index.html **#
#************************************************************#
# The following script is supposed to test what actions are
# supported by what device with what version of the firmware
DIRECTORY=$(cd `dirname $0` && pwd)
source $DIRECTORY/fritzBoxShellConfig.sh
## declare an array variable
declare -a services=("WLAN_2G" "WLAN_2G" "WLAN_5G" "WLAN_2G" "WLAN" "LAN" "DSL" "WAN" "LINK" "IGDWAN" "IGDDSL" "IGDIP" )
declare -a actions=("STATISTICS" "STATE" "STATISTICS" "STATE" "STATE" "STATE" "STATE" "STATE" "STATE" "STATE" "STATE" "STATE" )
declare -a minwords=(3 5 3 5 9 1 1 1 1 1 1 1 )
## now loop through the above array
counter=0
for i in "${services[@]}"
do
echo -n "$i" "${actions[$counter]}"
words=$(/bin/bash $DIRECTORY/fritzBoxShell.sh "$i" "${actions[$counter]}"|wc -w)
#echo -n $words
[[ "$words" -ge ${minwords[$counter]} ]] && echo -e "\tis working!" || echo -e "\tis not working!"
counter=$((counter+1))
done
/bin/bash $DIRECTORY/fritzBoxShell.sh Deviceinfo 3 | grep NewModelName
/bin/bash $DIRECTORY/fritzBoxShell.sh Deviceinfo 3 | grep NewSoftwareVersion