init.d-filtrage_firewall 1.26 KB
Newer Older
1
#! /bin/sh
2 3 4 5 6 7 8 9 10
### BEGIN INIT INFO
# Provides:          filtrage_firewall
# Required-Start:    $remote_fs $syslog firewall
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Filtrage Firewall
# Description:       Firewall logfile Parsing.
### END INIT INFO
11 12


13
set -e
14 15 16 17 18 19 20 21 22

case "$1" in
  start)
	echo -n "Dmarrage du script de parsage des logs du firewall"
	start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/filtrage_firewall.pid --exec /usr/scripts/surveillance/filtrage_firewall.py
        echo "."
	;;
  stop)
        echo -n "Arrt du parsage des logs du firewall"
salles's avatar
salles committed
23
	start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/filtrage_firewall.pid
24 25 26 27 28
        echo "."
	;;

  restart)
        echo -n "Redmarrage du parsage des logs du firewall"
salles's avatar
salles committed
29
	start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/filtrage_firewall.pid
30 31
        sleep 1
	echo -n "Dmarrage du script de parsage des logs du firewall"
salles's avatar
salles committed
32
	start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/filtrage_firewall.pid --exec /usr/scripts/surveillance/filtrage_firewall.py
33 34 35 36
        echo "."
	;;

  *)
salles's avatar
salles committed
37
	echo "Usage: /etc/init.d/filtrage_firewall {start|stop|restart}"
38 39 40 41
	exit 1
esac
 
exit 0