From: Benjamin Coddington Date: Thu, 29 Mar 2018 15:27:25 +0000 (-0400) Subject: common/rc: improve checks for YP/NIS X-Git-Tag: v2022.05.01~1611 X-Git-Url: http://git.apps.os.sepia.ceph.com/?p=xfstests-dev.git;a=commitdiff_plain;h=43374a62325ee6256b0e2c81489807c136e71a51 common/rc: improve checks for YP/NIS At the 2018 spring NFS BAT, we have a number of systems that return a valid string from `domainaname`, but don't have the ypcat binary. If we don't have the yp-tools package installed, we're not going to be able to use ypcat, so check for it and bail out. Signed-off-by: Benjamin Coddington Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/common/rc b/common/rc index 6a91850c..5dbb8fe5 100644 --- a/common/rc +++ b/common/rc @@ -2023,7 +2023,8 @@ _yp_active() { local dn dn=$(domainname 2>/dev/null) - test -n "${dn}" -a "${dn}" != "(none)" -a "${dn}" != "localdomain" + local ypcat=$(type -P ypcat) + test -n "${dn}" -a "${dn}" != "(none)" -a "${dn}" != "localdomain" -a -n "${ypcat}" echo $? }