# 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 "
"
# > /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 '
'${Rufnummer}'
'
#> /dev/null 2>&1
```
### socat as syslog server
`socat -u udp4-listen:514,bind=192.0.2.10, open:/tmp/syslog,creat,append`