Here is another one ...
#!/bin/bash
#
# Xindice This starts and stops Xindice.
#
# chkconfig: 345 82 15
# description: Xindice is an XML database
# Source function library.
. /etc/init.d/functions
# Setting Java environement
export JAVA_HOME=/usr/java/j2sdk1.4.0
export PATH=$PATH:$JAVA_HOME/bin
# Setting xindice home
export XINDICE_HOME=/usr/local/xindice
start(){
echo -n $"Starting Xindice: "
# Starting up Xindice
daemon /usr/local/xindice/start > /dev/null &
RETVAL=$?
echo
return $RETVAL
}
stop(){
echo -n $"Stopping Xindice: "
/usr/local/xindice/bin/xindiceadmin shutdown -c /db
RETVAL=$?
echo
return $RETVAL
}
reload(){
stop
start
}
restart(){
stop
start
}
condrestart(){
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
if ps -ef | grep -c "java -Xms16m -Xmx168m -Dxindice" > /dev/null
then echo "Xindice is running ..."
else echo "Xindice is stopped ..."
fi
echo
;;
restart)
restart
;;
reload)
reload
;;
condrestart)
condrestart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
RETVAL=1
esac
exit $RETVAL
On Thu, 23 May 2002, Carsten Ziegert wrote:
> Am 23.05.2002 18:52 Uhr schrieb "Fernando Padilla" unter
> <[EMAIL PROTECTED]>:
>
> >
> > Hello.
> >
> > Has anyone out there created a script that can be used for the init.d
> > system?
> >
> > fernando
> >
> >
>
>
> Try this one:
>
> #!/bin/sh
>
> JAVA_HOME=/usr/java
> export JAVA_HOME
>
> XINDICE_HOME=/home/summit/xindice
> export XINDICE_HOME
>
>
> if [ $# -lt 1 ]
> then
> echo "usage: xindice [ start | stop ]"
> exit
> fi
>
> if [ "$1" = "start" ]
> then
> cd $XINDICE_HOME
> ./start &
> exit
> fi
>
> if [ "$1" = "stop" ]
> then
> $XINDICE_HOME/bin/xindiceadmin shutdown -c /db
> exit
> fi
>
> echo "usage: xindice [ start | stop ]"
> exit
>
>
>
> :-) Carsten
>
> --
>
> Medizinische Hochschule Hannover Fachhochschule Hannover
> Abt. H�matologie und Onkologie FB Informations- und Kommunikationswesen
> Carl-Neuberg-Stra�e 1 Ricklinger Stadtweg 120
> 30625 Hannover 30459 Hannover
>
> ++49-511-9296-1650
> http://summit-bmt.fh-hannover.de
>
>
>
>
>
>
--
Stijn Van Vreckem