chris@1: #!/bin/bash bei@32: cd `dirname $0`/.. bei@32: NEWSROOT=`pwd` bei@32: CLASSPATH=$NEWSROOT/lib/sonews.jar:\ bei@32: $NEWSROOT/lib/sonews-helpers.jar:\ bei@32: $NEWSROOT/lib/mysql-connector-java.jar:\ bei@32: $NEWSROOT/lib/glassfish-mail.jar:\ bei@32: $NEWSROOT/lib/postgresql.jar chris@1: bei@32: LOGFILE=/var/log/sonews.log bei@32: PIDFILE=/var/pid/sonews.pid chris@1: ARGS=$@ chris@1: 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