1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

Remove unneeded external IP address check

This commit is contained in:
Joe Groocock 2016-04-17 23:33:20 +01:00
parent 7c26b1b885
commit b60dfcc6a7

View File

@ -40,23 +40,17 @@ if [[ "$(cat /sys/class/net/$IF/operstate)" = 'down' ]]; then
fi
case $1 in
-4)
AF=inet ;;
-6)
AF=inet6 ;;
*)
AF=inet6? ;;
-4) AF=inet ;;
-6) AF=inet6 ;;
*) AF=inet6? ;;
esac
# if no interface is found, use the first device with a global scope
LOCIP=$(ip addr show $IF | perl -n -e "/$AF ([^\/]+).* scope global/ && print \$1 and exit")
EXTIP=$(curl -s http://whatismijnip.nl |cut -d " " -f 5)
#------------------------------------------------------------------------
case $BLOCK_BUTTON in
1) echo "$EXTIP";;
# 2) echo -n "$LOCIP" | xclip -q -se c ;;
# 3) echo -n "$EXTIP" | xclip -q -se c ;;
1) echo $(curl -s http://whatismijnip.nl | cut -d " " -f 5);;
*) echo "$LOCIP";;
esac