diff --git a/Bundler/arpwatch.xml b/Bundler/arpwatch.xml index 1b778bb..8c261be 100644 --- a/Bundler/arpwatch.xml +++ b/Bundler/arpwatch.xml @@ -3,4 +3,5 @@ + diff --git a/Cfg/etc/init.d/arpwatch_sendmail/arpwatch_sendmail b/Cfg/etc/init.d/arpwatch_sendmail/arpwatch_sendmail new file mode 100644 index 0000000..92637d2 --- /dev/null +++ b/Cfg/etc/init.d/arpwatch_sendmail/arpwatch_sendmail @@ -0,0 +1,50 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: arpwatch_sendmail +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: arpwatch_sendmail +# Description: Report mail d'arpwatch +### END INIT INFO + +NAME=arpwatch_sendmail +PIDF=/var/run/$NAME.pid +BIN_PATH=/usr/scripts/surveillance/arpwatch +PATH=/sbin:/bin:/usr/sbin:/usr/bin +ARGS=root@crans.org +BIN="$BIN_PATH/sendmail_server.py" +DESCR="Script d'envoi de mails arpwatch" + +. /lib/lsb/init-functions + +set -e + +case "$1" in + start) + echo -n "Démarrage de $NAME" + /sbin/start-stop-daemon --start --quiet --pidfile $PIDF --exec $BIN $ARGS + echo "." + ;; + stop) + echo -n "Arrêt de $NAME" + /sbin/start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDF + echo "." + ;; + + restart) + echo -n "Redémarrage (arrêt) de $NAME" + /sbin/start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDF + /bin/sleep 1 + echo -n "Redémarrage (démarrage) de $NAME" + /sbin/start-stop-daemon --start --quiet --pidfile $PIDF --exec $BIN $ARGS + echo "." + ;; + + *) + echo "Usage: /etc/init.d/$NAME {start|stop|restart}" + exit 1 +esac + +exit 0 diff --git a/Cfg/etc/init.d/arpwatch_sendmail/info.xml b/Cfg/etc/init.d/arpwatch_sendmail/info.xml new file mode 100644 index 0000000..a0b21f3 --- /dev/null +++ b/Cfg/etc/init.d/arpwatch_sendmail/info.xml @@ -0,0 +1,3 @@ + + +