replace getent with grep, so that multiple entries/protocols are got for services
[firewall-squeep] / common.sh
index b3bcda876348f8c4b3b25ec2129ebea0063d1171..c4da5fdfa43c8e41ed6e5abf9c9cdc54a665c19e 100644 (file)
--- 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