summaryrefslogtreecommitdiff
path: root/etc/functions/myip
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-01-29 20:13:19 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-01-29 20:13:19 +0100
commit26b014bfa2dfca19bd97415ab335717e13fcc02a (patch)
tree205c530e4bc135b90b3338e3e1adebdbe79b6211 /etc/functions/myip
parent7f7dcfc232e5f8e02008de55d00b9b4faa5f17f5 (diff)
Add myip function
Diffstat (limited to 'etc/functions/myip')
-rw-r--r--etc/functions/myip9
1 files changed, 9 insertions, 0 deletions
diff --git a/etc/functions/myip b/etc/functions/myip
new file mode 100644
index 0000000..0775c45
--- /dev/null
+++ b/etc/functions/myip
@@ -0,0 +1,9 @@
+if ifdata -e wlan0 && [[ $(cat /sys/class/net/wlan0/operstate) == up ]]; then
+ ifdata -pa wlan0
+
+else
+ ifdata -pa lan
+
+fi
+
+curl https://derf.homelinux.org/cgi-bin/clientinfo/ip.cgi