From: root Date: Tue, 21 Feb 2017 18:27:47 +0000 (-0800) Subject: replace getent with grep, so that multiple entries/protocols are got for services X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=283b321d8414f8134c9ed46d64b5402d0161985f;p=firewall-squeep replace getent with grep, so that multiple entries/protocols are got for services --- 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