Script de démarrage/arrêt du client ices

A mettre dans un fichier /etc/init.d/ices-start-stop.sh et le tester.

#!/bin/sh
#
# $Id$
#

USER=yvan
PRG=/usr/bin/ices2

test -x ${PRG} || exit 0

CONF=/home/yvan/ices-canalb.xml

case "$1" in
	start)
		echo -n "Starting CANALB client:"
		if [ -f "${CONF}" ]; then
			/bin/su - ${USER} -c "${PRG} ${CONF}" &
			echo "${PRG}."
		else
			echo "${CONF} : No such file."
			exit 1
		fi
	;;
	stop)
		echo -n "Stopping CANALB client: ${PRG}"
		PID=`/bin/ps aux | /bin/grep ices2 | /bin/grep -v grep | /usr/bin/tr -s " " | /usr/bin/cut -d " " -f2`
		/bin/kill ${PID}
		echo "."
	;;
	restart)
		$0 stop
		sleep 2
		$0 start
	;;
	*)
		echo  "Usage: /etc/init.d/ices-start-stop {start|stop|restart}"
		exit 1
esac

exit 0


Ensuite, le mettre en démarrage automatique :

update-rc.d ices-start-stop.sh defaults
 
script_icescanalb.txt · Dernière modification: Le 16/09/2005 à 13:44 par migrate-to-doku     Haut de page
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki Design by Chirripó