Merge pull request #2237 from a1346054/which

Use bash-builtin `command -v` instead of external `which`
This commit is contained in:
Dirk Wetter
2022-09-14 21:25:14 +02:00
committed by GitHub
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=""