fix more shellcheck
This commit is contained in:
parent
e83e898eed
commit
55fc647568
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue