From e93cc1c9407902e23abe01ca08317de98a95f148 Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Thu, 15 Nov 2018 11:02:00 +0100 Subject: [PATCH] [ip-check] Inital on check ip --- Makefile | 2 ++ ip-check | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 ip-check diff --git a/Makefile b/Makefile index bc81ab7..7605272 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,8 @@ exiv2-common-edits \ confluence-tk \ json2yaml \ yaml2json \ +ip-check \ + bash-completion = \ repo-encrypt \ diff --git a/ip-check b/ip-check new file mode 100644 index 0000000..bbca48f --- /dev/null +++ b/ip-check @@ -0,0 +1,25 @@ +#!/bin/bash + +dir="$(dirname "$0")" +base="$(basename "$0")" +tmp="/tmp" +curl_out="$tmp/$base-$$-out.html" + +baseurl="http://checkip.dyndns.org" + +curl -s -L "$baseurl" | \ + tee "$curl_out" | \ + sed -e 's/.*Current IP Address: //' -e 's/<.*$//' + +baseurl="http://192.168.0.1" +cookie="$tmp/$base-$$.cook" + +curl "$baseurl/DprSetup.asp" -v \ + --compressed --cookie "$cookie" --cookie-jar "$cookie" + +curl "$baseurl/goform/login" \ + -L \ + --form "login_password=bananklase" \ + --compressed --cookie "$cookie" --cookie-jar "$cookie" \ + -v + -- 2.39.2