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
maint-2.0.2
Ludovic Marcotte 2009-08-27 19:15:04 +00:00
parent a38722d9cb
commit d416156e38
1 changed files with 6 additions and 1 deletions

View File

@ -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 &