author | chris <chris@marvin> |
Wed, 01 Jul 2009 10:48:22 +0200 | |
changeset 2 | 1090e2141798 |
parent 1 | 6fceb66e1ad7 |
child 3 | 2fdc9cc89502 |
permissions | -rwxr-xr-x |
1 #!/bin/bash
2 SCRIPTROOT=$(pwd)
3 CLASSPATH=$SCRIPTROOT/lib/sonews.jar:\
4 $SCRIPTROOT/lib/mysql-connector-java.jar:\
5 $SCRIPTROOT/lib/glassfish-mail.jar:\
6 $SCRIPTROOT/lib/postgresql.jar
8 LOGFILE=sonews.log
9 PIDFILE=sonews.pid
10 ARGS=$@
12 MAINCLASS=org.sonews.daemon.Main
13 JAVA=java
15 case "$1" in
16 start)
17 echo "Starting sonews Newsserver..."
18 $JAVA -classpath $CLASSPATH $MAINCLASS $ARGS &> $LOGFILE &
19 echo $! > $PIDFILE
20 ;;
21 stop)
22 echo "Stopping sonews Newsserver..."
23 PID=`cat $PIDFILE`
24 kill -15 $PID
25 ;;
26 setup)
27 $JAVA -classpath $CLASSPATH org.sonews.util.DatabaseSetup
28 ;;
29 purge)
30 $JAVA -classpath $CLASSPATH org.sonews.util.Purger
31 ;;
33 *)
34 echo "Usage: sonews [start|stop|setup|purge]"
35 esac