chris@1: #!/bin/bash franta-hg@76: franta-hg@76: JAVA_HOME="/usr/lib/jvm/java-6-openjdk"; franta-hg@76: NEWSROOT="/home/fiki/src/sonews-nntp/sonews-11-dev"; franta-hg@76: bei@32: cd `dirname $0`/.. bei@32: NEWSROOT=`pwd` franta-hg@76: CLASSPATH=$NEWSROOT/build/sonews.jar:\ franta-hg@76: $NEWSROOT/lib/commons-codec-1.5.jar:\ bei@32: $NEWSROOT/lib/mysql-connector-java.jar:\ franta-hg@76: $NEWSROOT/lib/javax.mail.jar:\ franta-hg@76: $NEWSROOT/lib/postgresql-8.3-604.jdbc4.jar:\ franta-hg@76: $NEWSROOT/lib/mysql-connector-java-5.1.7-bin.jar chris@1: franta-hg@76: LOGFILE=var/log/sonews.log franta-hg@76: PIDFILE=var/pid/sonews.pid chris@1: ARGS=$@ chris@1: franta-hg@76: bei@32: MAINCLASS=org.sonews.Main bei@32: JAVA=$JAVA_HOME/bin/java chris@1: chris@1: case "$1" in chris@1: start) chris@1: echo "Starting sonews Newsserver..." chris@1: $JAVA -classpath $CLASSPATH $MAINCLASS $ARGS &> $LOGFILE & chris@1: echo $! > $PIDFILE chris@1: ;; chris@1: stop) chris@1: echo "Stopping sonews Newsserver..." chris@1: PID=`cat $PIDFILE` chris@1: kill -15 $PID chris@1: ;; chris@1: setup) chris@1: $JAVA -classpath $CLASSPATH org.sonews.util.DatabaseSetup chris@1: ;; chris@1: purge) chris@1: $JAVA -classpath $CLASSPATH org.sonews.util.Purger chris@1: ;; chris@1: chris@1: *) chris@1: echo "Usage: sonews [start|stop|setup|purge]" chris@1: esac