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