Skip to content

Instantly share code, notes, and snippets.

@jmark
Last active February 26, 2016 18:41
Show Gist options
  • Save jmark/db788180a2648ae08031 to your computer and use it in GitHub Desktop.
Save jmark/db788180a2648ae08031 to your computer and use it in GitHub Desktop.
Bash script: Force reconnect for router Fritz!Box 7360 SL (FRITZ!OS: 06.20)
#!/bin/bash
# date: 2015-01-24
# Inspiration from: http://www.gtkdb.de/index_7_1302.html
payload=$(cat <<EOF
<?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:ForceTermination xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1" />
</s:Body>
</s:Envelope>
EOF
)
curl \
-s 'http://fritz.box:49000/igdupnp/control/WANIPConn1' \
-H 'Content-Type: text/xml; charset=utf-8' \
-H 'SoapAction: urn:schemas-upnp-org:service:WANIPConnection:1#ForceTermination' \
-d "$payload" \
>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment