Subversion Repositories eFlore/Applications.del

Rev

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

#!/bin/sh

### BEGIN INIT INFO
# Provides:          tb_del
# 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 et emails DEL
# Description:       Start/stop les scripts de maintenance et d'envoie d'emails de DEL.
### END INIT INFO

#/etc/init.d/
# 
# Aurélien Peronnet [7 avril 2011]
# Service de lancement des scripts DEL
#
case "$1" in

start)

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

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

;;

stop)

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

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

;;

status)

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

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

;;


*)

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

exit 1

;;

esac