replace getent with grep, so that multiple entries/protocols are got for services
authorroot <root@chirp.squeep.com>
Tue, 21 Feb 2017 18:27:47 +0000 (10:27 -0800)
committerroot <root@chirp.squeep.com>
Tue, 21 Feb 2017 18:27:47 +0000 (10:27 -0800)
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