bin/sonews.sh
author cli
Tue Apr 27 21:51:12 2010 +0200 (2010-04-27)
changeset 26 407c428adb5b
parent 1 6fceb66e1ad7
child 32 3af4237e4a15
permissions -rwxr-xr-x
Introduce more advanced help system (#565).
     1 #!/bin/bash
     2 SCRIPTROOT=$(pwd)
     3 CLASSPATH=$SCRIPTROOT/lib/sonews.jar:\
     4 $SCRIPTROOT/lib/sonews-helpers.jar:\
     5 $SCRIPTROOT/lib/mysql-connector-java.jar:\
     6 $SCRIPTROOT/lib/glassfish-mail.jar:\
     7 $SCRIPTROOT/lib/postgresql.jar
     8 
     9 LOGFILE=sonews.log
    10 PIDFILE=sonews.pid
    11 ARGS=$@
    12 
    13 MAINCLASS=org.sonews.daemon.Main
    14 JAVA=java
    15 
    16 case "$1" in
    17   start)
    18     echo "Starting sonews Newsserver..."
    19     $JAVA -classpath $CLASSPATH $MAINCLASS $ARGS &> $LOGFILE &
    20     echo $! > $PIDFILE
    21     ;;
    22   stop)
    23     echo "Stopping sonews Newsserver..."
    24     PID=`cat $PIDFILE`
    25     kill -15 $PID
    26     ;;
    27   setup)
    28     $JAVA -classpath $CLASSPATH org.sonews.util.DatabaseSetup
    29     ;;
    30   purge)
    31     $JAVA -classpath $CLASSPATH org.sonews.util.Purger
    32     ;;
    33 
    34   *)
    35     echo "Usage: sonews [start|stop|setup|purge]"
    36 esac