#!/bin/sh case "$(hostname -s)" in mother) if_main="eth1" if_alt="eth0" ;; po-rbo) if_main="enx4ce1734c425a" if_alt="wlp1s0" ;; fbsd-tp) if_main="em0" if_alt="wlan0" exit ;; esac if grep up "/sys/class/net/$if_main/operstate" >/dev/null 2>&1 && ! [ -z $(ifconfig $if_main 2>/dev/null | awk '/inet / {print $2}') ]; then : elif grep up "/sys/class/net/$if_alt/operstate" >/dev/null 2>&1 && ! [ -z $(ifconfig $if_alt 2>/dev/null | awk '/inet / {print $2}') ]; then if_main=$if_alt else echo '${font1}NET ${hr}${font} ${color #928374}No network${font}' exit fi echo '${font1}NET ${hr 2}${font} ${color #928374}Interface: ${font2}${color #ebdbb2}'$if_main'${font} ${color #928374}--------- ${color #928374}LAN IP: ${font2}${color #ebdbb2}${addr '$if_main'}${font} ${color #928374}DNS IP: ${font2}${color #ebdbb2}${nameserver 0}${font} ${color #928374}WAN IP: ${color #ebdbb2}${font2}${execi 300 curl -s https://ifconfig.me || echo No WAN}${font} ${color #928374}--------- ${color #928374}D: ${color #ebdbb2}${font2}${downspeed '$if_main'}${font}${goto 125}${color #928374}Total D: ${color #ebdbb2}${font2}${totaldown '$if_main'}${font} ${color #928374}U: ${color #ebdbb2}${font2}${upspeed '$if_main'}${goto 125}${font}${color #928374}Total U: ${color #ebdbb2}${font2}${totalup '$if_main'}${font}' # ${color #928374}VPN IP: ${font2}${color #ebdbb2}${addr proton0}${font}