diff --git a/Scripts/sogo b/Scripts/sogo new file mode 100755 index 000000000..5514064ae --- /dev/null +++ b/Scripts/sogo @@ -0,0 +1,50 @@ +#! /bin/sh + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +DAEMON=/usr/local/sbin/sogod-0.9 +NAME=sogo +DESC="Scalable OpenGroupware.Org" + +PIDFILE=/var/run/sogo/sogod.pid + +SOGO_ARGS="" + +if [ -f /etc/default/sogo ]; then + . /etc/default/sogo +fi + +test -x $DAEMON || exit 0 + +#set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon -c sogo --pidfile $PIDFILE \ + -b --start --quiet --exec $DAEMON + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + killall sogod-0.9 2> /dev/null + rm -f $PIDFILE + echo "$NAME." + ;; + restart|force-reload) + echo -n "Restarting $DESC: " + killall sogod-0.9 2> /dev/null + rm -f $PIDFILE + sleep 1 + start-stop-daemon -c sogo --pidfile $PIDFILE \ + -b --start --quiet --exec $DAEMON + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/Scripts/sogocron.sh b/Scripts/sogocron.sh new file mode 100755 index 000000000..1b1f87d44 --- /dev/null +++ b/Scripts/sogocron.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +export PATH=/usr/local/sbin:$PATH + +cd /root/SOGo +# echo "Pulling monotone repository" + +oldversion=$(mtn status) +mtn pull >& /dev/null +mtn update >& /dev/null +newversion=$(mtn status) + +if [ "$oldversion" == "$newversion" ] +then + exit 0 +fi + +echo "SOGo mainsite updated at $(date)..." + +. /root/GNUstep/Library/Makefiles/GNUstep.sh >& /dev/null +make distclean > /dev/null +./configure --disable-strip --without-gnustep >& /dev/null +make -s > /dev/null +rm -rf /usr/local/lib/sogod-0.9 +make -s install > /dev/null +# echo "Copying templates to /usr/local/share/sogo-0.9/templates" +# rm -rf /usr/local/share/sogo-0.9/templates +# cp -a UI/Templates /usr/local/share/sogo-0.9/templates +# echo "Copying web resources to /usr/local/share/sogo-0.9/www" +# cp -a UI/WebServerResources /usr/local/share/sogo-0.9/www +# echo "Killing server" +pkill sogod-0.9 >& /dev/null +# echo "Starting sogod-0.9 (log in /var/log/sogod)" +echo "Launching on $(date)" > /var/log/sogod +sogod-0.9 >> /var/log/sogod 2>&1 & +