Subversion Repositories eFlore/Applications.cel

Rev

Rev 2417 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#!/bin/sh

### BEGIN INIT INFO
# Provides:          tb_cel
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Should-Start:      $all
# Should-Stop:       $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop scripts maintenance CEL
# Description:       Start/stop les scripts de maintenance de CEL.
### END INIT INFO

#/etc/rc.d/init.d/
# 
# Aurélien PERONNET [17 avril 2013]
# Service de lancement des scripts de maintenance du CEL
#
case "$1" in

start)

echo "Demarrage de code_insee_commune :"
nohup /usr/local/sbin/code_insee_commune.sh 1>/dev/null 2>/dev/null &

;;

stop)

echo "Arret de code_insee_commune"
PID=`ps -eaf | grep code_insee_commune | grep -v grep | tr -s ' ' | cut -d' ' -f2 | head -n1`
kill -9 ${PID}

;;

status)

echo -n "Voici les PID du processus code_insee_commune :"
PID=`ps -eaf | grep code_insee_commune | grep -v grep | tr -s ' ' | cut -d' ' -f2 | head -n1`
echo ${PID}

;;


*)

echo "Usage:  {start|stop|status}"

exit 1

;;

esac