Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 1 commit
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 25 additions and 11 deletions.
  1. +1 −1 Makefile
  2. +24 −10 common/checkip
View
2 Makefile
@@ -1,4 +1,4 @@
-VERSION = 2.03
+VERSION = 2.04
PN = checkip
PREFIX ?= /usr
View
34 common/checkip
@@ -18,14 +18,6 @@ makeconfig() {
#TARGETEMAIL='youremail@foo.com'
TARGETEMAIL=
-# Return address.
-#FROM='returnaddress@bar.com'
-FROM=
-
-# SMTP server.
-#SMTP='smtp.bar.com'
-SMTP=
-
# Your username.
#USERNAME='myusername'
USERNAME=
@@ -36,6 +28,14 @@ USERNAME=
#SMTP_USER_PASS='mypassword'
SMTP_USER_PASS=
+# Return address.
+#FROM='returnaddress@bar.com'
+FROM=
+
+# SMTP server.
+#SMTP='smtp.bar.com'
+SMTP=
+
# Select which method of authentication you wish to use when sending mails.
# Valid options are shown below; select one.
# SSL uses port 465 while STARTTL uses port 587
@@ -116,12 +116,26 @@ run() {
OLDIP=$(cat "$DB")
fi
+ # Get the IP address
+ # Script tries three different websites to do so:
+ # 1. http://www.whatsmyip.us
+ # 2. http://icanhazip.com
+ # 3. http://ifconfig.me
+
CURRENTIP=$(curl $PROXY -s http://www.whatsmyip.us/ | grep "</textarea>"| sed 's/[</].*$//')
+
+ if [[ -z "$CURRENTIP" ]]; then
+ CURRENTIP=$(curl $PROXY -s http://icanhazip.com/)
+ fi
+
+ if [[ -z "$CURRENTIP" ]]; then
+ CURRENTIP=$(curl $PROXY -s http://ifconfig.me/)
+ fi
if [[ -z "$CURRENTIP" ]]; then
# net up or down
- CHECK="WAN or website down, no action taken."
- echo -e ${BLD}${RED}" Null value detected. Either www.whatsmyup.us is down or your net is down."${NRM}
+ CHECK="WAN or websites are down, no action taken."
+ echo -e ${BLD}${RED}" Null value detected."${NRM}
writelog
exit 1
fi

No commit comments for this range

Something went wrong with that request. Please try again.