Archived
1
0
Fork 0
This repository has been archived on 2024-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/simpleDots/bin/reconnectfritzbox.sh

26 lines
715 B
Bash
Raw Permalink Normal View History

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