updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / zemberek-server / zemberek
blob29e39e811df7ce3fa97840bc74932aaee145010d
1 #!/bin/bash
3 # general config
4 . /etc/rc.conf
5 . /etc/rc.d/functions
6 . /etc/conf.d/zemberek
8 # Decide which java to use!
10 if [ -f /etc/profile.d/jdk.sh ] ;then
11 source /etc/profile.d/jdk.sh
12 elif [ -f /etc/profile.d/jre.sh ]; then
13 source /etc/profile.d/jre.sh
14 elif [ -f /etc/profile.d/openjdk6.sh ]; then
15 source /etc/profile.d/openjdk6.sh
16 else
17 echo "YOU NEED TO INSTALL JAVA!"
20 PID=$(pidof -- $JAVA_HOME/bin/java ${ZEMBEREK_ARGS})
21 case "$1" in
22 start)
23 stat_busy "Starting Zemberek Server"
24 if [ -z "$PID" ]; then
25 $JAVA_HOME/bin/java ${ZEMBEREK_ARGS} > /dev/null &
27 if [ ! -z "$PID" -o $? -gt 0 ]; then
28 stat_fail
29 else
30 add_daemon zemberek
31 stat_done
34 stop)
35 stat_busy "Stopping Zemberek Server"
36 [ ! -z "$PID" ] && kill $PID &> /dev/null
37 if [ $? -gt 0 ]; then
38 stat_fail
39 else
40 rm_daemon zemberek
41 stat_done
44 restart)
45 $0 stop
46 sleep 1
47 $0 start
50 echo "usage: $0 {start|stop|restart}"
52 esac
53 exit 0