fix more shellcheck

This commit is contained in:
Rob Walker 2018-06-23 13:12:24 -07:00
parent e83e898eed
commit 55fc647568
1 changed files with 10 additions and 4 deletions

View File

@ -2,10 +2,16 @@
function myip() function myip()
{ {
declare ipaddrs=( declare ipaddrs=( )
$(curl -s ifconfig.co) # query interwebs
$(ifconfig | awk '/inet(6)? (addr:)?/ {print $2}') # machine interfaces # query interwebs
) mapfile -t ipaddrs < <(curl -s ifconfig.co)
# machine's interfaces
mapfile -t -O "${#ipaddrs[*]}" ipaddrs < \
<(ifconfig | awk '/inet(6)? (addr:)?/ {print $2}')
ipaddrs=( "${extips[@]}" "${ipaddrs[@]}" )
if (( ! ${#ipaddrs[*]} )) if (( ! ${#ipaddrs[*]} ))
then then