Merge branch 'master' of mathias-kettner.de:omd
[omd.git] / debian / init.in
blob060aae15d8c9382a342d6df91fcad1c565423042
1 #!/bin/sh
2 # Startskript for OMD sites
4 ### BEGIN INIT INFO
5 # Provides: omd-###OMD_VERSION###
6 # Required-Start: $syslog
7 # Required-Stop: $syslog
8 # Default-Start: 2 3 4 5
9 # Default-Stop: 0 1 6
10 # Short-Description: OMD sites
11 # Description: Start and stop the sites of the OpenSource Monitoring
12 # Distribution (OMD)
13 ### END INIT INFO
15 # -- start omd, if not disabled in /etc/default/omd
16 AUTOSTART=1
17 [ -r /etc/default/omd ] && . /etc/default/omd
19 VERSION=###OMD_VERSION###
20 VER="-V $VERSION"
21 MSG="using omd version $VERSION"
22 OMD="/omd/versions/$VERSION/bin/omd"
24 case "$1" in
25 start)
26 if [ "$AUTOSTART" = "1" ]; then
27 echo "Starting all OMD monitoring sites $MSG:"
28 $OMD "$1" $VER
29 else
30 echo "OMD autostart disabled, skipping ..."
33 stop)
34 echo "Stopping all OMD monitoring sites $MSG:"
35 $OMD "$1" $VER
37 restart)
38 echo "Restarting all OMD monitoring sites $MSG:"
39 $OMD "$1" $VER
41 reload)
42 echo "Reloading all OMD monitoring sites $MSG:"
43 $OMD "$1" $VER
45 status)
46 echo "Checking state of all OMD monitoring sites $MSG:"
47 $OMD "$1" $VER
49 '')
50 echo "usage: $PROGNAME start|stop|restart|reload|status"
51 exit 1
54 echo "Doing $1 on all OMD monitoring sites $MSG:"
55 $OMD "$1" $VER
57 esac