script/init.d/ethercat
author Florian Pose <fp@igh-essen.com>
Fri, 10 Aug 2007 15:27:08 +0000
branchstable-1.3
changeset 1744 7bc131b92039
parent 1740 fa0af75bfbe9
child 1745 07fd94c5119d
permissions -rwxr-xr-x
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
1740
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
#!/bin/sh
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     3
#------------------------------------------------------------------------------
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
#
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     5
#  Init script for EtherCAT
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     6
#
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     7
#  $Id$
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     8
#
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     9
#  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    10
#
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    11
#  This file is part of the IgH EtherCAT Master.
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    12
#
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    13
#  The IgH EtherCAT Master is free software; you can redistribute it
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    14
#  and/or modify it under the terms of the GNU General Public License
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    15
#  as published by the Free Software Foundation; either version 2 of the
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    16
#  License, or (at your option) any later version.
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    17
#
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    18
#  The IgH EtherCAT Master is distributed in the hope that it will be
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    19
#  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    20
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    21
#  GNU General Public License for more details.
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    22
#
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    23
#  You should have received a copy of the GNU General Public License
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    24
#  along with the IgH EtherCAT Master; if not, write to the Free Software
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    25
#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    26
#
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    27
#  The right to use EtherCAT Technology is granted and comes free of
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    28
#  charge under condition of compatibility of product made by
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    29
#  Licensee. People intending to distribute/sell products based on the
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    30
#  code, have to sign an agreement to guarantee that products using
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    31
#  software based on IgH EtherCAT master stay compatible with the actual
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    32
#  EtherCAT specification (which are released themselves as an open
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    33
#  standard) as the (only) precondition to have the right to use EtherCAT
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    34
#  Technology, IP and trade marks.
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    35
#
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    36
#------------------------------------------------------------------------------
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    37
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    38
### BEGIN INIT INFO
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    39
# Provides:          ethercat
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    40
# Required-Start:    $local_fs $syslog $network
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    41
# Should-Start:      $time ntp
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    42
# Required-Stop:     $local_fs $syslog $network
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    43
# Should-Stop:       $time ntp
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    44
# Default-Start:     3 5
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    45
# Default-Stop:      0 1 2 6
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    46
# Short-Description: IgH EtherCAT master modules
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    47
# Description:
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    48
### END INIT INFO
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    49
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    50
#------------------------------------------------------------------------------
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    51
1744
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    52
MODPROBE=/sbin/modprobe
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    53
RMMOD=/sbin/rmmod
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    54
MODINFO=/sbin/modinfo
1740
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    55
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    56
#------------------------------------------------------------------------------
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    57
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    58
ETHERCAT_CONFIG=/etc/sysconfig/ethercat
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    59
1744
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    60
if [ ! -r ${ETHERCAT_CONFIG} ]; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    61
    echo ${ETHERCAT_CONFIG} not existing;
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    62
    if [ "${1}" = "stop" ]; then
1740
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    63
	exit 0
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    64
    else
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    65
	exit 6
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    66
    fi
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    67
fi
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    68
1744
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    69
. ${ETHERCAT_CONFIG}
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    70
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    71
#------------------------------------------------------------------------------
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    72
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    73
function exit_success()
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    74
{
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    75
    if [ -r /etc/rc.status ]; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    76
        rc_reset
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    77
        rc_status -v
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    78
        rc_exit
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    79
    else
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    80
        echo " done"
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    81
        exit 0
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    82
    fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    83
}
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    84
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    85
#------------------------------------------------------------------------------
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    86
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    87
function exit_running()
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    88
{
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    89
    if [ -r /etc/rc.status ]; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    90
        rc_reset
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    91
        rc_status -v
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    92
        rc_exit
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    93
    else
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    94
        echo " running"
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    95
        exit 0
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    96
    fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    97
}
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    98
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
    99
#------------------------------------------------------------------------------
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   100
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   101
function exit_fail()
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   102
{
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   103
    if [ -r /etc/rc.status ]; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   104
        rc_failed
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   105
        rc_exit
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   106
    else
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   107
        echo " failed"
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   108
        exit 1
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   109
    fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   110
}
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   111
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   112
#------------------------------------------------------------------------------
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   113
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   114
function parse_mac_address()
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   115
{
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   116
    if [ -z "${1}" ]; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   117
        MAC=""
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   118
    elif echo ${1} | grep -qE '^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$'; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   119
        MAC=${1}
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   120
    else
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   121
        echo Invalid MAC address \"${1}\" in ${ETHERCAT_CONFIG}
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   122
        exit_fail
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   123
    fi 
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   124
}
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   125
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   126
#------------------------------------------------------------------------------
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   127
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   128
if [ -r /etc/rc.status ]; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   129
    . /etc/rc.status
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   130
    rc_reset
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   131
fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   132
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   133
case "${1}" in
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   134
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   135
start)
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   136
    echo -n "Starting EtherCAT master "
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   137
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   138
    # construct DEVICES and BACKUPS from configuration variables
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   139
    DEVICES=""
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   140
    BACKUPS=""
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   141
    MASTER_INDEX=0
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   142
    while true; do
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   143
        DEVICE=$(eval echo "\${MASTER${MASTER_INDEX}_DEVICE}")
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   144
        BACKUP=$(eval echo "\${MASTER${MASTER_INDEX}_BACKUP}")
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   145
        if [ -z "${DEVICE}" ]; then break; fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   146
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   147
        if [ ${MASTER_INDEX} -gt 0 ]; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   148
            DEVICES=${DEVICES},
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   149
            BACKUPS=${BACKUPS},
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   150
        fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   151
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   152
        parse_mac_address ${DEVICE}
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   153
        DEVICES=${DEVICES}${MAC}
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   154
        
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   155
        parse_mac_address ${BACKUP}
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   156
        BACKUPS=${BACKUPS}${MAC}
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   157
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   158
        MASTER_INDEX=$(expr ${MASTER_INDEX} + 1)
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   159
    done
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   160
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   161
    # load master module
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   162
    if ! ${MODPROBE} ec_master main=${DEVICES} backup=${BACKUPS}; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   163
        exit_fail
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   164
    fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   165
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   166
    # check for modules to replace
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   167
    for MODULE in ${DEVICE_MODULES}; do
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   168
        ECMODULE=ec_${MODULE}
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   169
        if ! ${MODINFO} ${ECMODULE} > /dev/null; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   170
            continue # ec_* module not found
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   171
        fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   172
        if lsmod | grep "^${MODULE} " > /dev/null; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   173
            if ! ${RMMOD} ${MODULE}; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   174
                exit_fail
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   175
            fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   176
        fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   177
        if ! ${MODPROBE} ${ECMODULE}; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   178
            ${MODPROBE} ${MODULE} # try to restore module
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   179
            exit_fail
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   180
        fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   181
    done
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   182
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   183
    exit_success
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   184
    ;;
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   185
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   186
stop)
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   187
    echo -n "Shutting down EtherCAT master "
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   188
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   189
    # unload EtherCAT device modules
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   190
    for MODULE in ${DEVICE_MODULES} master; do
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   191
        ECMODULE=ec_${MODULE}
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   192
        if ! lsmod | grep -q "^${ECMODULE} "; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   193
            continue # ec_* module not loaded
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   194
        fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   195
        if ! ${RMMOD} ${ECMODULE}; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   196
            exit_fail
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   197
        fi;
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   198
    done
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   199
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   200
    sleep 1
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   201
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   202
    # reload previous modules
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   203
    for MODULE in ${DEVICE_MODULES}; do
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   204
        if ! ${MODPROBE} ${MODULE}; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   205
            echo Warning: Failed to restore ${MODULE}.
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   206
        fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   207
    done
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   208
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   209
    exit_success
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   210
    ;;
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   211
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   212
restart)
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   213
    $0 stop || exit 1
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   214
    sleep 1
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   215
    $0 start
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   216
    ;;
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   217
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   218
status)
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   219
    echo -n "Checking for EtherCAT "
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   220
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   221
    lsmod | grep -q "^ec_master "
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   222
    MASTERS_RUNNING=$?
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   223
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   224
    ! grep -q "(WAITING)" /sys/ethercat/master*/info
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   225
    MASTERS_IDLE=$?
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   226
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   227
    # master module loaded and masters not waiting for devices?
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   228
    if [ ${MASTERS_RUNNING} -eq 0 -a ${MASTERS_IDLE} -eq 0 ]; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   229
        exit_running
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   230
    else
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   231
        exit_fail
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   232
    fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   233
    ;;
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   234
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   235
*)
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   236
    echo "USAGE: $0 {start|stop|restart|status}"
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   237
    ;;
1740
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   238
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   239
esac
fa0af75bfbe9 MERGE -r759:762 trunk -> branches/stable-1.2 (release 1.2, part two).
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   240
1744
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   241
if [ -r /etc/rc.status ]; then
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   242
    rc_exit
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   243
else
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   244
    exit 1
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   245
fi
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   246
7bc131b92039 MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents: 1740
diff changeset
   247
#------------------------------------------------------------------------------