Home

Awesome

<!--- [![start with why](https://img.shields.io/badge/start%20with-why%3F-brightgreen.svg?style=flat)](http://www.ted.com/talks/simon_sinek_how_great_leaders_inspire_action) --->

GitHub release GitHub tag made-with-bash GitHub license GitHub issues GitHub issues-closed contributions welcome GitHub contributors Github All Releases Github All Releases

FritzBoxShell

AVM_FRITZ_Labor_FRITZBox_7490-min.jpg

(Image credit: https://avm.de/presse/pressefotos/?q=7490)

Introduction

The script allows you to control/check your FritzBox from the terminal with a shell script. It is planned to add more functions in the future. The shell script uses cURL to create an SOAP request based on the TR-064 protocol to talk to the AVM Fritz!Box and AVM Fritz!Repeater.

To change state of the LEDs in front of the Fritz!Box or activate the keylock (buttons on the can be activated or deactivated) the TR-064 protocol does not offer the possibility. Therefore the AHA-HTTP-Interface is used. This only works from firmware version 7.10 and upwards.

Please raise an issue with your function you would like to add.

Become a part of it!

If you want to check out if your AVM device actually works with this script, you can do so by executing fritzBoxShellTest.sh. It prints for (almost) every Service/Action pair if they delivered data when called.

Authentication is handled exactly as described for fritzBoxShell.sh.

The result is a list written to the console containing the names of the checked service and actions followed by the result of the check. Finally, the device type and firmware version are printed (of course only if this functionality was accessible!).

As an example - the result for my Fritz!Box:

WLAN_2G STATISTICS43	is working!
WLAN_2G STATE6	is working!
WLAN_5G STATISTICS43	is working!
WLAN_2G STATE6	is working!
WLAN STATE12	is working!
LAN STATE8	is working!
DSL STATE0	is not working!
WAN STATE16	is working!
LINK STATE0	is not working!
IGDWAN STATE28	is working!
IGDDSL STATE15	is working!
IGDIP STATE48	is working!
NewModelName FRITZ!Box 6490 Cable (kdg)
NewSoftwareVersion 141.06.87

Installing, configuring and first script execution

Head over to the Wiki pages to get all the information: https://github.com/jhubig/FritzBoxShell/wiki/Installation,-Configuration-&-First-test

Arguments/Enviroments

You can use variables or arguments. However, arguments are visible in the process list and are therefore not recommended for passwords.

If these arguments or environment variables are not set, then the values from the fritzBoxShellConfig.sh are used.

Here an example (This will enable the 2.4 Ghz network on the box with the following IP):

./fritzBoxShell.sh --boxip 192.168.178.1 --boxuser foo --boxpw baa WLAN_2G 1

EnviromentArgumentDescription
BoxIP--boxipIP or DNS of FritzBox
BoxUSER--boxuserUsername
BoxPW--boxpwLogin password for user.
RepeaterIP--repeateripIP or DNS of FritzRepeater
RepeaterUSER--repeateruserUsually on Fritz!Repeater no User is existing. Can be left empty.
RepeaterPW--repeaterpwPassword for user.

Usage

After the successful installation and setup following functions should be available.

ActionParameterDescription
DEVICEINFOSTATEShow information about your Fritz!Box like ModelName, SN, etc.
WLAN_2G0 or 1 or STATESwitching ON, OFF or checking the state of the 2,4 Ghz WiFi
WLAN_2GSTATISTICSStatistics for the 2,4 Ghz WiFi easily digestible by telegraf
WLAN_2GQRCODEShow a qr code to connect to the 2,4 Ghz WiFi
WLAN_2GCHANGECH and <channel>Change channel of the 2,4 Ghz WiFi to optional <channel> (random if absent)
WLAN_5G0 or 1 or STATESwitching ON, OFF or checking the state of the 5 Ghz WiFi
WLAN_5GSTATISTICSStatistics for the 5 Ghz WiFi easily digestible by telegraf
WLAN_5GQRCODEShow a qr code to connect to the 5 Ghz WiFi
WLAN_5GCHANGECH and <channel>Change channel of the 5 Ghz WiFi to optional <channel> (random if absent)
WLAN_GUEST0 or 1 or STATESwitching ON, OFF or checking the state of the Guest WiFi
WLAN_GUESTSTATISTICSStatistics for the Guest WiFi easily digestible by telegraf
WLAN_GUESTQRCODEShow a qr code to connect to the Guest WiFi
WLAN0 or 1 or STATESwitching ON, OFF or checking the state of the 2,4Ghz and 5 Ghz WiFi
WLANQRCODEShow a qr code to connect to the 2,4 and 5 Ghz and Guest WiFi
WLANCHANGECH and <channel>Change channel of the 2,4 and 5 Ghz WiFi to optional <channel>
TAM<index> and GetInfoe.g. TAM 0 GetInfo (gives info about answering machine)
TAM<index> and ON or OFFe.g. TAM 0 ON (switches ON the answering machine)
TAM<index> and GetMsgse.g. TAM 0 GetMsgs (gives XML formatted list of messages)
LED0 or 1Switching ON (1) or OFF (0) the LEDs in front of the Fritz!Box
LED_BRIGHTNESS1 or 2 or 3Setting the brightness of the LEDs in front of the Fritz!Box
KEYLOCK0 or 1Activate (1) or deactivate (0) the Keylock (buttons de- or activated)
SIGNAL_STRENGTH100,50,25,12 or 6 %Set your signal strength (channel settings will then be set to manual)
WIREGUARD_VPN<name> and 0 or 1Name of your connection in "" (e.g. "Test 1"). 0 (OFF) and 1 (ON)
MISC_LUAtotalConnectionsWLAN/LANNumber of total connected WLAN/LAN clients (incl. full Mesh)
LANSTATEStatistics for the LAN easily digestible by telegraf
DSLSTATEStatistics for the DSL easily digestible by telegraf
WANSTATEStatistics for the WAN easily digestible by telegraf
WANRECONNECTAsk for a new IP Address from your provider
LINKSTATEStatistics for the WAN DSL LINK easily digestible by telegraf
IGDWANSTATEStatistics for the WAN LINK easily digestible by telegraf
IGDDSLSTATEStatistics for the DSL LINK easily digestible by telegraf
IGDIPSTATEStatistics for the DSL IP easily digestible by telegraf
REPEATER0Switching OFF the WiFi of the Repeater
REBOOTBox or RepeaterRebooting your Fritz!Box or Fritz!Repeater
UPNPMetaDataSTATE or <filename>Full unformatted output of tr64desc.xml to console or file
IGDMetaDataSTATE or <filename>Full unformatted output of igddesc.xml to console or file
VERSION<N/A>Version of the fritzBoxShell.sh

Notes:

External Links

Here you can find more information on TR-064 protocol and the available actions in your Fritz!Box or Fritz!Repeater.

AVM, FRITZ!, Fritz!Box and the FRITZ! logo are registered trademarks of AVM GmbH - https://avm.de/

donate

<a href="https://paypal.me/jhubig/"><img src="https://github.com/andreostrovsky/donate-with-paypal/blob/master/blue.svg" height="30"></a>
If you like this project — or just feeling generous, consider buying me a beer. Cheers! :beers: