Use bash-builtin command -v instead of external which

`command -v` is a bash builtin and is a standardized version of `which`
This commit is contained in:
a1346054
2022-09-12 23:24:26 +00:00
parent b3c49b584d
commit 902bdf3d92
3 changed files with 5 additions and 5 deletions

View File

@ -74,7 +74,7 @@ datebanner() {
dns() {
ip4=`host -t a $1 | grep -v alias | sed 's/^.*address //'`
which getent 2>&1 >/dev/null && getent ahostsv4 $1 2>&1 >/dev/null && ip4=`getent ahostsv4 $1 | awk '{ print $1}' | uniq`
command -v getent 2>&1 >/dev/null && getent ahostsv4 $1 2>&1 >/dev/null && ip4=`getent ahostsv4 $1 | awk '{ print $1}' | uniq`
NODEIP=`echo "$ip4" | head -1`
rDNS=`host -t PTR $NODEIP | sed -e 's/^.*pointer //' -e 's/\.$//'`
echo $rDNS | grep -q NXDOMAIN && rDNS=""