diff options
Diffstat (limited to 'src/op_mode/show_ip_external.sh')
-rwxr-xr-x | src/op_mode/show_ip_external.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/op_mode/show_ip_external.sh b/src/op_mode/show_ip_external.sh new file mode 100755 index 000000000..275d05278 --- /dev/null +++ b/src/op_mode/show_ip_external.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# Detect an external IP address +# Use random services for checking + + +array=( + ipinfo.io/ip + ifconfig.me + ipecho.net/plain + icanhazip.com + v4.ident.me + checkip.amazonaws.com +) + +size=${#array[@]} +index=$(($RANDOM % $size)) + +curl --silent ${array[$index]} | tr -d "[:space:]" && echo |