comparison .ssh/athome @ 266:33541d73d6d7

RHEL8 at least has different syntax for which, this should allow both to work without incident
author Steve Huston <huston@princeton.edu>
date Wed, 24 Apr 2024 16:53:52 -0400
parents df0b24d4fabd
children 6dc992e4fc4a
comparison
equal deleted inserted replaced
265:df0b24d4fabd 266:33541d73d6d7
18 MYIP=`curl -s checkip.amazonaws.com` 18 MYIP=`curl -s checkip.amazonaws.com`
19 19
20 # Now how to get the home IP.. let's loop through ways it's possible 20 # Now how to get the home IP.. let's loop through ways it's possible
21 HOMEDNS="b6800200.eero.online" 21 HOMEDNS="b6800200.eero.online"
22 22
23 if which -s getent awk ; then 23 if which -s getent awk > /dev/null 2>&1 ; then
24 HOMEIP=`getent ahostsv4 $HOMEDNS | awk '{print $1; exit}'` 24 HOMEIP=`getent ahostsv4 $HOMEDNS | awk '{print $1; exit}'`
25 elif which -s dig ; then 25 elif which -s dig ; then
26 HOMEIP=`dig +short $HOMEDNS` 26 HOMEIP=`dig +short $HOMEDNS`
27 else 27 else
28 exit $off 28 exit $off