#! /bin/sh
#
# lisa       Bring up/down lisa - lan browser for KDE
#
# chkconfig: 2345 80 17
# description: lan browser daemon for KDE
#
# Source function library.
. /etc/init.d/functions

LISA=/usr/sbin/lisa
ARGS=

[ -x $LISA ] || exit 0

start() {
        echo -n "Starting lan browser daemon for KDE: "
	daemon $LISA -c /etc/lisarc $ARGS
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/lisa
}

stop() {
        echo -n "Stopping lan browser daemon for KDE: "
        killproc $LISA
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/lisa
}


case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    restart)
	## If first returns OK call the second, if first or
	## second command fails, set echo return value.
	stop
	sleep 1
	start
	;;
    reload)
	stop
	start
	;;
    status)
	echo -n "Checking for lan browser daemon for KDE: "
	status lisa
	RETVAL=$?
	;;
  condstart)
	if ! status lisa &>/dev/null; then
		start
	fi
	;;
  condstop)
	if status lisa &>/dev/null; then
		stop
	fi
	;;
  condrestart)
	if status lisa &>/dev/null; then
		stop
		sleep 1
		start
	fi
	;;
  *)
	echo "Usage: $0 {start|stop|status|restart|reload|condstart|condstop|condrestart}"
	RETVAL=1
	;;
esac
exit $RETVAL
