correct depends between *wake* services
[debian6500.git] / master / etc / init.d / waitswitches
CommitLineData
d1be43ee
LM
1#!/bin/sh
2VER=1.0
3# ============================================================================
4#
5# Copyright (C) THALES. All rights reserved
6# Author: Thomas Perennou (Viveris Technologies)
7# Date : 03/12/2014
8# ============================================================================
9
10### BEGIN INIT INFO
40cb1de8 11# Provides: waitswitches
d1be43ee
LM
12# Required-Start: $network
13# Required-Stop:
14# Should-Start:
40cb1de8
LM
15# Default-Start: S
16# Default-Stop:
d1be43ee
LM
17# Short-Description: Wait switches
18# Description: Wait for all switches are ready for running
19### END INIT INFO
20
21ENABLE="yes"
22SCRIPT=/opt/trc6500/script/check_switches.sh
23TIMEOUT=360
24
25PATH=/sbin:/usr/sbin:/bin:/usr/bin
26[ -f /etc/default/waitswitches ] && . /etc/default/waitswitches
27[ -x $SCRIPT ] || exit 1
28[ "$ENABLE" = "yes" ] || exit 0
29
30. /lib/lsb/init-functions
31
32do_start () {
33 log_action_msg "Wait all switches"
34 $SCRIPT -t $TIMEOUT -w
35}
36
37case "$1" in
38 -v)
39 echo "$(basename $0), version $VER"
40 ;;
41 start)
42 do_start
43 ;;
44 restart|reload|force-reload)
45 echo "Error: argument '$1' not supported" >&2
46 exit 3
47 ;;
48 stop)
49 # No-op
50 ;;
51 *)
52 echo "Usage: $0 start|stop" >&2
53 exit 3
54 ;;
55esac
56
57# vim:set tabstop=4 expandtab shiftwidth=4: