network-public-ip.sh
1 #!/usr/bin/env bash 2 3 # setting the locale, some users have issues with different locales, this forces the correct one 4 export LC_ALL=en_US.UTF-8 5 6 current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 7 source $current_dir/utils.sh 8 9 main() { 10 IP_SERVER="ifconfig.me" 11 ip=$(curl -s "$IP_SERVER") 12 13 IP_LABEL=$(get_tmux_option "@dracula-network-public-ip-label" "") 14 echo "$IP_LABEL $ip" 15 } 16 17 # run the main driver 18 main