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.
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