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 fi
case $1 in case $1 in
-4) -4) AF=inet ;;
AF=inet ;; -6) AF=inet6 ;;
-6) *) AF=inet6? ;;
AF=inet6 ;;
*)
AF=inet6? ;;
esac esac
# if no interface is found, use the first device with a global scope # 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") 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 case $BLOCK_BUTTON in
1) echo "$EXTIP";; 1) echo $(curl -s http://whatismijnip.nl | cut -d " " -f 5);;
# 2) echo -n "$LOCIP" | xclip -q -se c ;;
# 3) echo -n "$EXTIP" | xclip -q -se c ;;
*) echo "$LOCIP";; *) echo "$LOCIP";;
esac esac