author | František Kučera <franta-hg@frantovo.cz> |
Mon Oct 17 18:14:34 2011 +0200 (2011-10-17) | |
changeset 89 | c60625d58158 |
parent 32 | 3af4237e4a15 |
child 91 | 70286a6cf338 |
permissions | -rwxr-xr-x |
chris@1 | 1 |
#!/bin/bash |
franta-hg@76 | 2 |
|
franta-hg@76 | 3 |
JAVA_HOME="/usr/lib/jvm/java-6-openjdk"; |
franta-hg@76 | 4 |
NEWSROOT="/home/fiki/src/sonews-nntp/sonews-11-dev"; |
franta-hg@76 | 5 |
|
bei@32 | 6 |
cd `dirname $0`/.. |
bei@32 | 7 |
NEWSROOT=`pwd` |
franta-hg@76 | 8 |
CLASSPATH=$NEWSROOT/build/sonews.jar:\ |
franta-hg@76 | 9 |
$NEWSROOT/lib/commons-codec-1.5.jar:\ |
bei@32 | 10 |
$NEWSROOT/lib/mysql-connector-java.jar:\ |
franta-hg@76 | 11 |
$NEWSROOT/lib/javax.mail.jar:\ |
franta-hg@76 | 12 |
$NEWSROOT/lib/postgresql-8.3-604.jdbc4.jar:\ |
franta-hg@76 | 13 |
$NEWSROOT/lib/mysql-connector-java-5.1.7-bin.jar |
chris@1 | 14 |
|
franta-hg@76 | 15 |
LOGFILE=var/log/sonews.log |
franta-hg@76 | 16 |
PIDFILE=var/pid/sonews.pid |
chris@1 | 17 |
ARGS=$@ |
chris@1 | 18 |
|
franta-hg@76 | 19 |
|
bei@32 | 20 |
MAINCLASS=org.sonews.Main |
bei@32 | 21 |
JAVA=$JAVA_HOME/bin/java |
chris@1 | 22 |
|
chris@1 | 23 |
case "$1" in |
chris@1 | 24 |
start) |
chris@1 | 25 |
echo "Starting sonews Newsserver..." |
chris@1 | 26 |
$JAVA -classpath $CLASSPATH $MAINCLASS $ARGS &> $LOGFILE & |
chris@1 | 27 |
echo $! > $PIDFILE |
chris@1 | 28 |
;; |
chris@1 | 29 |
stop) |
chris@1 | 30 |
echo "Stopping sonews Newsserver..." |
chris@1 | 31 |
PID=`cat $PIDFILE` |
chris@1 | 32 |
kill -15 $PID |
chris@1 | 33 |
;; |
chris@1 | 34 |
setup) |
chris@1 | 35 |
$JAVA -classpath $CLASSPATH org.sonews.util.DatabaseSetup |
chris@1 | 36 |
;; |
chris@1 | 37 |
purge) |
chris@1 | 38 |
$JAVA -classpath $CLASSPATH org.sonews.util.Purger |
chris@1 | 39 |
;; |
chris@1 | 40 |
|
chris@1 | 41 |
*) |
chris@1 | 42 |
echo "Usage: sonews [start|stop|setup|purge]" |
chris@1 | 43 |
esac |