From 283b321d8414f8134c9ed46d64b5402d0161985f Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Feb 2017 10:27:47 -0800 Subject: [PATCH] replace getent with grep, so that multiple entries/protocols are got for services --- common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.sh b/common.sh index b3bcda8..c4da5fd 100644 --- a/common.sh +++ b/common.sh @@ -166,7 +166,7 @@ function allow_services(){ case "${s}" in */*) add_service_entry "${s}" ;; - *) for svc in $(getent services "${s}" | awk '{print $2}') + *) for svc in $(egrep "^${s}\s+" /etc/services | decommentcat | awk '{print $2}') do add_service_entry "${svc}" done -- 2.43.2