now works with more than one network device

This commit is contained in:
Stephen
2020-11-27 10:53:46 -08:00
parent c8c81bc033
commit 2d8063981b
2 changed files with 2 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ alias gcc="gcc -g"
alias hora='date "+%H:%M:%S"' alias hora='date "+%H:%M:%S"'
alias ap="open /Applications/AirPods.app" alias ap="open /Applications/AirPods.app"
alias wthr='curl wttr.in/san_luis_obispo' alias wthr='curl wttr.in/san_luis_obispo'
alias nf='cl; neofetch; system_profiler SPSoftwareDataType | grep "System Version" | cut -d " " -f9 -f10 -f11| figlet -w 100; shownetinfo && lab && batt' alias nf='cl; neofetch; neofetch | grep OS | cut -d " " -f2 -f3 -f4 -f5 -f6 | figlet -w 100; shownetinfo && lab && batt'
# School # School
alias glp='~/Development/gp.sh' alias glp='~/Development/gp.sh'

View File

@@ -9,7 +9,7 @@ function shownetinfo() {
GW=$(ip route | grep default | cut -d " " -f3) GW=$(ip route | grep default | cut -d " " -f3)
elif [ "$OSTYPE" = "Darwin" ]; then elif [ "$OSTYPE" = "Darwin" ]; then
NET=$(system_profiler SPNetworkDataType | grep "Router:" | cut -c 19-30 | head -1) NET=$(system_profiler SPNetworkDataType | grep "Router:" | cut -c 19-30 | head -1)
IP=$(ifconfig en0 | grep -v "127.0.0.1" | grep "inet " | head -1 | cut -d " " -f2) IP=$(ifconfig | grep -v "127.0.0.1" | grep "inet " | head -1 | cut -d " " -f2)
if [ "$NET" != "" ]; then if [ "$NET" != "" ]; then
GW=$(dig +short myip.opendns.com @resolver1.opendns.com) GW=$(dig +short myip.opendns.com @resolver1.opendns.com)
fi fi