~upstart-devel/upstart/upstart-jobs

« back to all changes in this revision

Viewing changes to vivid/etc/init.d/fwlogwatch

  • Committer: Dimitri John Ledkov
  • Date: 2014-11-19 12:58:41 UTC
  • Revision ID: dimitri.j.ledkov@intel.com-20141119125841-98dr37roy8dvcv3b
auto update

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
### BEGIN INIT INFO
 
3
# Provides:          fwlogwatch
 
4
# Required-Start:    $remote_fs $syslog
 
5
# Required-Stop:     $remote_fs $syslog
 
6
# Default-Start:     2 3 4 5
 
7
# Default-Stop:      0 1 6
 
8
### END INIT INFO
 
9
#
 
10
# Original version by Robert Leslie
 
11
# <rob@mars.org>, edited by iwj and cs
 
12
# Modified for fwlogwatch by Alberto Gonzalez Iniesta <agi@agi.as>
 
13
 
 
14
test $DEBIAN_SCRIPT_DEBUG && set -v -x
 
15
 
 
16
DAEMON=/usr/sbin/fwlogwatch
 
17
CONFIG=/etc/fwlogwatch/fwlogwatch.config
 
18
DEFAULT=/etc/default/fwlogwatch
 
19
 
 
20
test -x $DAEMON || exit 0
 
21
test -f $CONFIG || exit 0
 
22
test -r $DEFAULT || exit 0
 
23
 
 
24
# Source configuration generated from debconf's values
 
25
. $DEFAULT
 
26
 
 
27
# Start fwlogwatch as a daemon?
 
28
if [ "$START_DAEMON" != "true" ]; then
 
29
  exit 0
 
30
fi
 
31
 
 
32
PIDFILE=`grep "^pidfile" $CONFIG | sed 's/.*=[\t ]*//' `
 
33
 
 
34
case "$1" in
 
35
start)
 
36
  echo -n "Starting firewall log watcher: fwlogwatch"
 
37
  start-stop-daemon --start --quiet \
 
38
        --exec $DAEMON -- -R $PARAMS
 
39
  echo "."
 
40
  ;;
 
41
stop)
 
42
  echo -n "Stopping firewall log watcher: fwlogwatch"
 
43
  start-stop-daemon --stop --quiet --oknodo \
 
44
        --exec $DAEMON --pidfile $PIDFILE
 
45
  echo "."
 
46
  ;;
 
47
restart|force-reload)
 
48
  $0 stop
 
49
  sleep 1
 
50
  $0 start
 
51
  ;;
 
52
*)
 
53
  echo "Usage: /etc/init.d/fwlogwatch {start|stop|restart|force-reload}" >&2
 
54
  exit 1
 
55
  ;;
 
56
esac
 
57
 
 
58
exit 0
 
59
 
 
60
# vim:set ai et sts=2 sw=2 tw=0: