1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/bin/sonews.sh Wed Jul 01 10:48:22 2009 +0200
1.3 @@ -0,0 +1,35 @@
1.4 +#!/bin/bash
1.5 +SCRIPTROOT=$(pwd)
1.6 +CLASSPATH=$SCRIPTROOT/lib/sonews.jar:\
1.7 +$SCRIPTROOT/lib/mysql-connector-java.jar:\
1.8 +$SCRIPTROOT/lib/glassfish-mail.jar:\
1.9 +$SCRIPTROOT/lib/postgresql.jar
1.10 +
1.11 +LOGFILE=sonews.log
1.12 +PIDFILE=sonews.pid
1.13 +ARGS=$@
1.14 +
1.15 +MAINCLASS=org.sonews.daemon.Main
1.16 +JAVA=java
1.17 +
1.18 +case "$1" in
1.19 + start)
1.20 + echo "Starting sonews Newsserver..."
1.21 + $JAVA -classpath $CLASSPATH $MAINCLASS $ARGS &> $LOGFILE &
1.22 + echo $! > $PIDFILE
1.23 + ;;
1.24 + stop)
1.25 + echo "Stopping sonews Newsserver..."
1.26 + PID=`cat $PIDFILE`
1.27 + kill -15 $PID
1.28 + ;;
1.29 + setup)
1.30 + $JAVA -classpath $CLASSPATH org.sonews.util.DatabaseSetup
1.31 + ;;
1.32 + purge)
1.33 + $JAVA -classpath $CLASSPATH org.sonews.util.Purger
1.34 + ;;
1.35 +
1.36 + *)
1.37 + echo "Usage: sonews [start|stop|setup|purge]"
1.38 +esac