Skip to content

Instantly share code, notes, and snippets.

@jahir
Created June 15, 2019 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jahir/45aebc0148f27f8d1cb7208a22ca8042 to your computer and use it in GitHub Desktop.
Save jahir/45aebc0148f27f8d1cb7208a22ca8042 to your computer and use it in GitHub Desktop.
fritzbox reconnect
#!/bin/sh
#wget -qO- "http://fritz.box:49000/igdupnp/control/WANIPConn1" --header "Content-Type: text/xml; charset="utf-8"" --header "SoapAction:urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress" --post-data="<?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:GetExternalIPAddress xmlns:u='urn:schemas-upnp-org:service:WANIPConnection:1' /> </s:Body> </s:Envelope>" | grep -Eo '\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>'
#wget -q "http://fritz.box:49000/upnp/control/wanipconnection1" --header='Content-Type: text/xml; charset="utf-8"' --header='SoapAction: urn:dslforum-org:service:WANIPConnection:1#ForceTermination' --post-data='<?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:dslforum-org:service:WANIPConnection:1" /> </s:Body> </s:Envelope>'
#wget \
# --header='Content-Type: text/xml; charset="utf-8"' \
# --header='SoapAction: urn:schemas-upnp-org:service:WANIPConnection:1#ForceTermination' \
# --post-data='<?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"></u:ForceTermination></s:Body></s:Envelope>' \
# 'http://fritz.box:49000/igdupnp/control/WANIPConn1'
curl \
-H 'Content-Type: text/xml; charset="utf-8"' \
-H "SoapAction: urn:schemas-upnp-org:service:WANIPConnection:1#ForceTermination" \
-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:ForceTermination xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1" /> </s:Body> </s:Envelope>' \
"http://fritz.box:49000/igdupnp/control/WANIPConn1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment