#! /bin/sh
set -e

exit 0


case "$1" in
  start)
	echo -n "Démarrage du script de parsage des logs du netacct"
	start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/filtrage_netacct.pid --exec /usr/scripts/surveillance/filtrage_netacct.py
        echo "."
	;;
  stop)
        echo -n "Arrêt du parsage des logs du netacct"
	start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/filtrage_netacct.pid
        echo "."
	;;

  restart)
        echo -n "Redémarrage du parsage des logs du netacct"
	start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/filtrage_netacct.pid
        sleep 1
	echo -n "Démarrage du script de parsage des logs du netacct"
	start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/filtrage_netacct.pid --exec /usr/scripts/surveillance/filtrage_netacct.py
        echo "."
	;;

  *)
	echo "Usage: /etc/init.d/filtrage_netacct {start|stop|restart}"
	exit 1
esac
 
exit 0
