arpwatch_sendmail: initscript
This commit is contained in:
parent
a04f2f5aa5
commit
62876e9e77
3 changed files with 54 additions and 0 deletions
|
@ -3,4 +3,5 @@
|
|||
<Service name="arpwatch"/>
|
||||
<Path name="/etc/default/arpwatch"/>
|
||||
<Python name="/etc/arpwatch.conf"/>
|
||||
<Path name="/etc/init.d/arpwatch_sendmail"/>
|
||||
</Bundle>
|
||||
|
|
50
Cfg/etc/init.d/arpwatch_sendmail/arpwatch_sendmail
Normal file
50
Cfg/etc/init.d/arpwatch_sendmail/arpwatch_sendmail
Normal file
|
@ -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
|
3
Cfg/etc/init.d/arpwatch_sendmail/info.xml
Normal file
3
Cfg/etc/init.d/arpwatch_sendmail/info.xml
Normal file
|
@ -0,0 +1,3 @@
|
|||
<FileInfo>
|
||||
<Info owner='root' group='root' perms='0755'/>
|
||||
</FileInfo>
|
Loading…
Add table
Add a link
Reference in a new issue