From d416156e38b73707a3e9921211f2c5c03b535ba4 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 27 Aug 2009 19:15:04 +0000 Subject: [PATCH] Improved the script so that when no WOPort parameter is defined, we fallback to 20000. Monotone-Parent: a8698cc119066cef660b176c3e956b5d0d843e7f Monotone-Revision: 4a2351cfd0ee0b84e1abe4b32284c6d363471ef3 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2009-08-27T19:15:04 Monotone-Branch: ca.inverse.sogo --- Scripts/sogod-wrapper | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Scripts/sogod-wrapper b/Scripts/sogod-wrapper index 5271d5fe5..5d11000ca 100755 --- a/Scripts/sogod-wrapper +++ b/Scripts/sogod-wrapper @@ -60,7 +60,7 @@ else fi woport=`defaults read sogod WOPort` -if [ "$?" == "0" ] +if [ "$?" -eq 0 ] then startport=`echo $woport | awk '{print $3}' | sed -e 's/\(.*:\)//'` else @@ -75,6 +75,11 @@ else fi listen=`echo $woport | awk '{ print $3 }' | sed -e 's/\([0-9]\+\)$/'$port'/g'` +if [ -z "$listen" ] +then + listen=$port +fi + # echo "SOGOD: $sogod -WOPort $listen" 2>&1 exec $sogod -WOPort $listen >> /var/log/sogo/sogod-$port.log 2>&1 &