Browse Source

first commit

daniel 4 years ago
commit
d122df860b
2 changed files with 42 additions and 0 deletions
  1. 21 0
      ipv4_updater.sh
  2. 21 0
      ipv6_updater.sh

+ 21 - 0
ipv4_updater.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+
+IPDATEI="/tmp/ipold_v4.txt"
+
+UPDATE=false
+IPNOW=$(/usr/bin/curl -s http://195.93.242.136/remoteip.php)
+
+if [ ! -f $IPDATEI ] ; then
+    UPDATE=true
+else
+    IPOLD=$(cat $IPDATEI)
+    if [ "$IPOLD" != "$IPNOW" ] ; then
+        UPDATE=true;
+    fi
+fi
+
+
+if $UPDATE ; then
+    echo $IPNOW > $IPDATEI
+    #Hier kommt später das Update hin.
+fi

+ 21 - 0
ipv6_updater.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+
+IPDATEI="/tmp/ipold_v6.txt"
+
+UPDATE=false
+IPNOW=$(/usr/bin/curl -s http://195.93.242.136/remoteip.php)
+
+if [ ! -f $IPDATEI ] ; then
+    UPDATE=true
+else
+    IPOLD=$(cat $IPDATEI)
+    if [ "$IPOLD" != "$IPNOW" ] ; then
+        UPDATE=true;
+    fi
+fi
+
+
+if $UPDATE ; then
+    echo $IPNOW > $IPDATEI
+    /usr/bin/curl -4 -s "https://inswe:nRcI84Q64vLoPcWw@ipv4.tunnelbroker.net/nic/update?hostname=232625" > /dev/null
+fi