From 43374a62325ee6256b0e2c81489807c136e71a51 Mon Sep 17 00:00:00 2001 From: Benjamin Coddington Date: Thu, 29 Mar 2018 11:27:25 -0400 Subject: [PATCH] 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 --- common/rc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 $? } -- 2.39.5