bin/sonews.sh
author František Kučera <franta-hg@frantovo.cz>
Fri Oct 14 13:32:34 2011 +0200 (2011-10-14)
changeset 78 969f001a0f5f
parent 32 3af4237e4a15
child 91 70286a6cf338
permissions -rwxr-xr-x
Drupal: XSLT odstavce – textové vs. netextové uzly.
     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