fritzbox tr064
This commit is contained in:
parent
dd57dfea9b
commit
6ae02a61f0
53
code-snippets.md
Normal file
53
code-snippets.md
Normal file
@ -0,0 +1,53 @@
|
||||
# Code Snippets
|
||||
|
||||
### fritzbox reboot
|
||||
- does not work under openwrt/ash!
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
# crontab-line
|
||||
# 5 2 * * 7 /root/reboot_fritzbox.sh
|
||||
# http://fritz.box:49000/tr64desc.xml
|
||||
# https://wiki.fhem.de/wiki/FRITZBOX#TR-064
|
||||
# https://avm.de/service/schnittstellen/
|
||||
|
||||
credentials=":password"
|
||||
FB="fritz.box:49000"
|
||||
|
||||
location_ext='/tr064/upnp/control/deviceconfig'
|
||||
location_int='/upnp/control/deviceconfig'
|
||||
uri='urn:dslforum-org:service:DeviceConfig:1'
|
||||
action='Reboot'
|
||||
|
||||
curl -v -4 -k --anyauth -u "${credentials}" http://${FB}${location_int} \
|
||||
-H 'Content-Type: text/xml; charset="utf-8"' \
|
||||
-H "SoapAction:${uri}#${action}" \
|
||||
-d "<?xml version='1.0' encoding='utf-8'?>
|
||||
<s:Envelope s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'
|
||||
xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body>
|
||||
<u:${action} xmlns:u='${uri}'></u:${action}></s:Body></s:Envelope>"
|
||||
# > /dev/null
|
||||
```
|
||||
|
||||
### fritzbox export debug report via call
|
||||
```bash
|
||||
#!/bin/bash
|
||||
credentials="username:pw"
|
||||
FB="10.0.1.1:49000"
|
||||
Rufnummer="*99#";
|
||||
|
||||
|
||||
curl -4 -k --anyauth -u "${credentials}" \
|
||||
"http://${FB}/upnp/control/x_voip" \
|
||||
-H 'Content-Type: text/xml; charset="utf-8"' \
|
||||
-H 'SoapAction: urn:dslforum-org:service:X_VoIP:1#X_AVM-DE_DialNumber' \
|
||||
-d '<?xml version="1.0" encoding="utf-8"?>
|
||||
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
|
||||
<s:Body>
|
||||
<u:X_AVM-DE_DialNumber xmlns:u="urn:dslforum-org:service:X_VoIP:1">
|
||||
<NewX_AVM-DE_PhoneNumber>'${Rufnummer}'</NewX_AVM-DE_PhoneNumber>
|
||||
</u:X_AVM-DE_DialNumber>
|
||||
</s:Body>
|
||||
</s:Envelope>'
|
||||
#> /dev/null 2>&1
|
||||
```
|
Loading…
Reference in New Issue
Block a user