Update 2024-02-14 07:51 OpenBSD/amd64-x13
This commit is contained in:
16
.bin/OLD/ext_ip_from_fritzbox.sh
Normal file
16
.bin/OLD/ext_ip_from_fritzbox.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
FRITZBOX="192.168.0.1"
|
||||
|
||||
PAYLOAD=\
|
||||
'<?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>'
|
||||
|
||||
curl -s "http://$FRITZBOX:49000/igdupnp/control/WANIPConn1" \
|
||||
-H "Content-Type: text/xml; charset=utf-8" \
|
||||
-H "SoapAction:urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress" \
|
||||
-d "$PAYLOAD" | grep -Eo "\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>"
|
||||
Reference in New Issue
Block a user