From f15e8d88ddec8d12fdcf247d4002f457af20582b Mon Sep 17 00:00:00 2001 From: Dragan Dosen Date: Tue, 19 May 2009 22:02:42 +0200 Subject: [PATCH] Ispravke vezane za provjeru ispravnosti konfiguracije. --- debian/postinst | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/debian/postinst b/debian/postinst index b6ff377..7e01fae 100644 --- a/debian/postinst +++ b/debian/postinst @@ -182,29 +182,41 @@ if [ -n "$services_file_list" ]; then service_user="`echo "$service_block" | sed -nr "s/^[[:space:]]*user[[:space:]]*=[[:space:]]*(.*)[[:space:]]*$/\1/p"`" if [ -n "$service_user" ]; then - service_user_chk="`getent passwd "$service_user"`" || true - if [ -z "$service_user_chk" ]; then - cp_echo "CN: Error in /etc/xinetd.d/$services_file for service '$service' - user '$service_user' does not exist." - service_disable=1 - fi + for service_user_x in $service_user; do + service_user_chk="`getent passwd $service_user_x`" || true + if [ -z "$service_user_chk" ]; then + cp_echo "CN: Error in /etc/xinetd.d/$services_file for service '$service' - user '$service_user_x' does not exist." + service_disable=1 + break + fi + done fi # Check service's group service_group="`echo "$service_block" | sed -nr "s/^[[:space:]]*group[[:space:]]*=[[:space:]]*(.*)[[:space:]]*$/\1/p"`" if [ -n "$service_group" ]; then - service_group_chk="`getent passwd "$service_group"`" || true - if [ -z "$service_group_chk" ]; then - cp_echo "CN: Error in /etc/xinetd.d/$services_file for service '$service' - group '$service_group' does not exist." - service_disable=1 - fi + for service_group_x in $service_group; do + service_group_chk="`getent passwd $service_group_x`" || true + if [ -z "$service_group_chk" ]; then + cp_echo "CN: Error in /etc/xinetd.d/$services_file for service '$service' - group '$service_group_x' does not exist." + service_disable=1 + break + fi + done fi # Check service's binary service_server="`echo "$service_block" | sed -nr "s/^[[:space:]]*server[[:space:]]*=[[:space:]]*(.*)[[:space:]]*$/\1/p"`" - if [ -n "$service_server" ] && [ ! -x "$service_server" ]; then - cp_echo "CN: Error in /etc/xinetd.d/$services_file for service '$service' - server '$service_server' does not exist." - service_disable=1 + if [ -n "$service_server" ]; then + + for service_server_x in $service_server; do + if [ ! -x "$service_server_x" ]; then + cp_echo "CN: Error in /etc/xinetd.d/$services_file for service '$service' - server '$service_server_x' does not exist." + service_disable=1 + break + fi + done fi if [ $service_disable -eq 1 ]; then -- 1.7.10.4