system/home/modules/window_manager/scripts/external_ip.sh

11 lines
232 B
Bash
Executable file

#!/usr/bin/env bash
res=$(dig +timeout=3 +retry=0 +short myip.opendns.com @resolver1.opendns.com 2>/dev/null)
if [ -z "$res+x" ]; then
text="NO CONN"
echo "%{F@error@}${text}%{F-}"
exit 0
fi
echo "%{F@success@}${res}%{F-}"