#!/bin/sh
#---------------------------------------------------------------
# Project         : MILLE-XTERM
# Module          : initscripts
# File            : xtermesd
# Version         : $Id: xtermesd 1936 2006-06-17 17:56:10Z francis $
# Author          : Jean-Michel Dault
# Created On      : Fri Mar 24 17:01:55 2006
#---------------------------------------------------------------
# chkconfig: 35 96 36
# description: MILLE-XTERM appserver esound configuration
#---------------------------------------------------------------

# Source function library.
. /etc/rc.d/init.d/functions

case $1 in 
start)
        mkdir -p /tmp/.esd
        chmod 1755 /tmp/.esd
        touch /tmp/.esd/socket
        pushd /lib >/dev/null
        ln -sf ../usr/lib/libesd.so.0 libesd.so
        popd >/dev/null
        if [ ! -f /root/.ssh/id_dsa.pub ]; then
          echo|ssh-keygen -q -t dsa -C '' -N ''
        fi
        cp /root/.ssh/id_dsa.pub /var/www/html
        gprintf "Configuring Esound support: "
        success
        echo
        echo $! > /var/lock/subsys/xtermesd
        ;;

    stop)
        gprintf "Stopping Esound support: "
        success
        echo
	;;

    status)
	;;

    reload)
	;;

    restart)
	$0 stop
	$0 start
	ret=$?
	;;
    *)
	gprintf "Usage: %s\n" "$(basename $0) {start|stop|restart|status}"
	exit 0
	;;
esac

exit $ret
