From 28e34ba8aa8b86043836e42c6be7f1a5ad02bfe6 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 23 Mar 2009 21:19:54 +0000 Subject: [PATCH] Monotone-Parent: d32a13b0eac81022df3f33f387e62593317e4287 Monotone-Revision: bf1f76a700dd5013f40d490b2329d5c127f21fbf Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-03-23T21:19:54 Monotone-Branch: ca.inverse.sogo --- Scripts/sogo-init.d-redhat | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Scripts/sogo-init.d-redhat b/Scripts/sogo-init.d-redhat index f89dddab6..12db1c858 100755 --- a/Scripts/sogo-init.d-redhat +++ b/Scripts/sogo-init.d-redhat @@ -59,20 +59,23 @@ if [ ! -x $DAEMON ]; then exit 1 fi -if [ `/usr/bin/stat /var/run/sogo -c %U` != "sogo" ]; then - echo "/var/run/sogo is not owned by the sogo user." - exit 1 -fi +checkDir() { + directory="$1" + if [ ! -d "$directory" ] + then + echo "$directory does not exist." + exit 1 + fi -if [ `/usr/bin/stat /var/spool/sogo -c %U` != "sogo" ]; then - echo "/var/spool/sogo is not owned by the sogo user." - exit 1 -fi + if [ `/usr/bin/stat "$directory" -c %U` != "$USER" ] + then + echo "$directory is not owned by the sogo user." + exit 1 + fi +} -if [ `/usr/bin/stat /var/log/sogo -c %U` != "sogo" ]; then - echo "/var/log/sogo is not owned by the sogo user." - exit 1 -fi +checkDir /var/run/sogo +checkDir /var/spool/sogo #set -e