updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / jdk / derby-network-server
blobf2b36ea562f65d9a42640a9f620962ff245c9215
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 . /etc/profile.d/jdk.sh
6 . $DERBY_HOME/bin/derby_common.sh
8 DAEMON_NAME="derby-network-server"
9 DAEMON_CONF="/etc/conf.d/$DAEMON_NAME"
10 DAEMON_PID="/var/run/$DAEMON_NAME.pid"
12 [ -f $DAEMON_CONF ] && . $DAEMON_CONF
14 DERBY_START_CMD="$JAVACMD $DERBY_OPTS -classpath \"$LOCALCLASSPATH\" org.apache.derby.drda.NetworkServerControl start"
15 DERBY_STOP_CMD="$JAVACMD $DERBY_OPTS -classpath \"$LOCALCLASSPATH\" org.apache.derby.drda.NetworkServerControl shutdown"
17 case "$1" in
18 start)
19 stat_busy "Starting Derby Network Server"
21 if ck_daemon $DAEMON_NAME; then
22 $DERBY_START_CMD > /dev/null &
24 PID=`ps ax | grep -v grep | grep derby | grep org.apache.derby.drda.NetworkServerControl | awk '{print $1}'`
26 if [ -z "$PID" ]; then
27 stat_fail
28 else
29 echo $PID > $DAEMON_PID
30 add_daemon $DAEMON_NAME
31 sleep 2
32 stat_done
33 fi
34 else
35 stat_fail
38 stop)
39 stat_busy "Stopping Derby Network Server"
41 if ck_daemon $DAEMON_NAME; then
42 stat_fail
43 else
44 $DERBY_STOP_CMD > /dev/null &
46 if [ $? -gt 0 ]; then
47 stat_fail
48 else
49 rm -f $DAEMON_PID
50 rm_daemon $DAEMON_NAME
51 stat_done
55 restart)
56 $0 stop
57 sleep 5
58 $0 start
61 echo "usage: $0 {start|stop|restart}"
62 esac
63 exit 0