chris@1: #!/bin/bash chris@1: SCRIPTROOT=$(pwd) chris@1: CLASSPATH=$SCRIPTROOT/lib/sonews.jar:\ chris@3: $SCRIPTROOT/lib/sonews-helpers.jar:\ chris@1: $SCRIPTROOT/lib/mysql-connector-java.jar:\ chris@1: $SCRIPTROOT/lib/glassfish-mail.jar:\ chris@1: $SCRIPTROOT/lib/postgresql.jar chris@1: chris@1: LOGFILE=sonews.log chris@1: PIDFILE=sonews.pid chris@1: ARGS=$@ chris@1: chris@1: MAINCLASS=org.sonews.daemon.Main chris@1: JAVA=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