#!/bin/bash # # slc-server SLC Server # # chkconfig: 3 92 92 # description: SLC Server # Source function library. . /etc/rc.d/init.d/functions RETVAL=0 start() { EXECDIR=/var/lib/slc-server cd $EXECDIR export JAVA_OPTS=-Xmx256m /usr/bin/slc -console 3040 & action $"Start SLC server" /bin/true return $RETVAL } stop() { /usr/bin/expect << EOF spawn telnet localhost 3040 expect "osgi>" send "close\r" EOF action $"Stop SLC server" /bin/true return $RETVAL } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart|reload) stop start RETVAL=$? ;; condrestart) echo Not implemented exit 1 ;; status) echo Not implemented exit 1 ;; *) echo $"Usage: $0 {start|stop|restart}" exit 1 esac exit $RETVAL