#!/bin/bash # Reconnect a Fritz.Box with activated UPnP oldIp=$(curl -s https://v4.ident.me) curl "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 ' ' \ -s sleep 5 newIp=$(curl -s https://v4.ident.me) notify-send "Renew IP" "Old IP: $oldIp\nNew IP: $newIp"