script/init.d/ethercat
author Florian Pose <fp@igh-essen.com>
Wed, 11 Jun 2008 13:01:21 +0000
changeset 989 816663ca9370
parent 942 dd13cdafc58c
child 1016 f831ef59426d
permissions -rwxr-xr-x
Slave information via 'ethercat slave'.
563
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
#!/bin/sh
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     3
#------------------------------------------------------------------------------
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
#
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     5
#  Init script for EtherCAT
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     6
#
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     7
#  $Id$
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     8
#
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     9
#  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    10
#
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    11
#  This file is part of the IgH EtherCAT Master.
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    12
#
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    13
#  The IgH EtherCAT Master is free software; you can redistribute it
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    14
#  and/or modify it under the terms of the GNU General Public License
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    15
#  as published by the Free Software Foundation; either version 2 of the
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    16
#  License, or (at your option) any later version.
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    17
#
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    18
#  The IgH EtherCAT Master is distributed in the hope that it will be
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    19
#  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    20
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    21
#  GNU General Public License for more details.
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    22
#
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    23
#  You should have received a copy of the GNU General Public License
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    24
#  along with the IgH EtherCAT Master; if not, write to the Free Software
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    25
#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    26
#
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    27
#  The right to use EtherCAT Technology is granted and comes free of
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    28
#  charge under condition of compatibility of product made by
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    29
#  Licensee. People intending to distribute/sell products based on the
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    30
#  code, have to sign an agreement to guarantee that products using
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    31
#  software based on IgH EtherCAT master stay compatible with the actual
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    32
#  EtherCAT specification (which are released themselves as an open
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    33
#  standard) as the (only) precondition to have the right to use EtherCAT
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    34
#  Technology, IP and trade marks.
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    35
#
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    36
#------------------------------------------------------------------------------
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    37
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    38
### BEGIN INIT INFO
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    39
# Provides:          ethercat
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    40
# Required-Start:    $local_fs $syslog $network
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    41
# Should-Start:      $time ntp
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    42
# Required-Stop:     $local_fs $syslog $network
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    43
# Should-Stop:       $time ntp
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    44
# Default-Start:     3 5
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    45
# Default-Stop:      0 1 2 6
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    46
# Short-Description: IgH EtherCAT master modules
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    47
# Description:
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    48
### END INIT INFO
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    49
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    50
#------------------------------------------------------------------------------
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    51
922
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
    52
CDEV='EtherCAT'
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    53
MODPROBE=/sbin/modprobe
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    54
RMMOD=/sbin/rmmod
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    55
MODINFO=/sbin/modinfo
563
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    56
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    57
#------------------------------------------------------------------------------
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    58
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    59
ETHERCAT_CONFIG=/etc/sysconfig/ethercat
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    60
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
    61
if [ ! -r ${ETHERCAT_CONFIG} ]; then
588
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
    62
    echo ${ETHERCAT_CONFIG} not existing;
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
    63
    if [ "${1}" = "stop" ]; then
563
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    64
	exit 0
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    65
    else
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    66
	exit 6
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    67
    fi
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    68
fi
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    69
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
    70
. ${ETHERCAT_CONFIG}
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
    71
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
    72
#------------------------------------------------------------------------------
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
    73
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    74
function exit_success()
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    75
{
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    76
    if [ -r /etc/rc.status ]; then
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    77
        rc_reset
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    78
        rc_status -v
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    79
        rc_exit
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    80
    else
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    81
        echo " done"
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    82
        exit 0
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    83
    fi
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    84
}
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    85
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    86
#------------------------------------------------------------------------------
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    87
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    88
function exit_running()
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    89
{
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    90
    if [ -r /etc/rc.status ]; then
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    91
        rc_reset
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    92
        rc_status -v
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    93
        rc_exit
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    94
    else
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    95
        echo " running"
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    96
        exit 0
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    97
    fi
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    98
}
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
    99
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   100
#------------------------------------------------------------------------------
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   101
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   102
function exit_fail()
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   103
{
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   104
    if [ -r /etc/rc.status ]; then
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   105
        rc_failed
702
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   106
        rc_status -v
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   107
        rc_exit
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   108
    else
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   109
        echo " failed"
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   110
        exit 1
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   111
    fi
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   112
}
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   113
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   114
#------------------------------------------------------------------------------
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   115
702
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   116
function exit_dead()
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   117
{
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   118
    if [ -r /etc/rc.status ]; then
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   119
        rc_failed
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   120
        rc_status -v
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   121
        rc_exit
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   122
    else
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   123
        echo " dead"
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   124
        exit 1
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   125
    fi
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   126
}
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   127
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   128
#------------------------------------------------------------------------------
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   129
639
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   130
function parse_mac_address()
563
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   131
{
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   132
    if [ -z "${1}" ]; then
639
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   133
        MAC=""
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   134
    elif echo ${1} | grep -qE '^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$'; then
639
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   135
        MAC=${1}
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   136
    else
639
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   137
        echo Invalid MAC address \"${1}\" in ${ETHERCAT_CONFIG}
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   138
        exit_fail
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   139
    fi 
563
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   140
}
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   141
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   142
#------------------------------------------------------------------------------
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   143
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   144
if [ -r /etc/rc.status ]; then
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   145
    . /etc/rc.status
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   146
    rc_reset
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   147
fi
563
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   148
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   149
case "${1}" in
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   150
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   151
start)
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   152
    echo -n "Starting EtherCAT master "
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   153
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   154
    # construct DEVICES and BACKUPS from configuration variables
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   155
    DEVICES=""
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   156
    BACKUPS=""
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   157
    MASTER_INDEX=0
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   158
    while true; do
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   159
        DEVICE=$(eval echo "\${MASTER${MASTER_INDEX}_DEVICE}")
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   160
        BACKUP=$(eval echo "\${MASTER${MASTER_INDEX}_BACKUP}")
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   161
        if [ -z "${DEVICE}" ]; then break; fi
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   162
639
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   163
        if [ ${MASTER_INDEX} -gt 0 ]; then
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   164
            DEVICES=${DEVICES},
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   165
            BACKUPS=${BACKUPS},
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   166
        fi
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   167
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   168
        parse_mac_address ${DEVICE}
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   169
        DEVICES=${DEVICES}${MAC}
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   170
        
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   171
        parse_mac_address ${BACKUP}
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 588
diff changeset
   172
        BACKUPS=${BACKUPS}${MAC}
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   173
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   174
        MASTER_INDEX=$(expr ${MASTER_INDEX} + 1)
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   175
    done
922
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   176
    MASTER_INDICES=`seq 0 $((${MASTER_INDEX} - 1))`
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   177
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   178
    # load master module
812
80c3d9c8292f Added MODPROBE_FLAGS variable.
Florian Pose <fp@igh-essen.com>
parents: 806
diff changeset
   179
    if ! ${MODPROBE} ${MODPROBE_FLAGS} ec_master \
80c3d9c8292f Added MODPROBE_FLAGS variable.
Florian Pose <fp@igh-essen.com>
parents: 806
diff changeset
   180
            main_devices=${DEVICES} backup_devices=${BACKUPS}; then
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   181
        exit_fail
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   182
    fi
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   183
922
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   184
    # remove stale device nodes
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   185
    rm -f /dev/${CDEV}*
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   186
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   187
    # get dynamic major number
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   188
    MAJOR=$(awk "\$2==\"EtherCAT\" {print \$1}" /proc/devices)
942
dd13cdafc58c Abort, if MAJOR number could not be determined.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   189
    if [ -z "${MAJOR}" ]; then
dd13cdafc58c Abort, if MAJOR number could not be determined.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   190
        echo "Failed to get device major number!"
dd13cdafc58c Abort, if MAJOR number could not be determined.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   191
        ${RMMOD} ec_master
dd13cdafc58c Abort, if MAJOR number could not be determined.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   192
        exit_fail
dd13cdafc58c Abort, if MAJOR number could not be determined.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   193
    fi
922
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   194
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   195
    # create character devices
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   196
    for i in ${MASTER_INDICES}; do
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   197
        mknod /dev/${CDEV}${i} c ${MAJOR} ${i}
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   198
    done
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   199
588
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   200
    # check for modules to replace
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   201
    for MODULE in ${DEVICE_MODULES}; do
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   202
        ECMODULE=ec_${MODULE}
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   203
        if ! ${MODINFO} ${ECMODULE} > /dev/null; then
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   204
            continue # ec_* module not found
588
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   205
        fi
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   206
        if lsmod | grep "^${MODULE} " > /dev/null; then
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   207
            if ! ${RMMOD} ${MODULE}; then
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   208
                exit_fail
588
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   209
            fi
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   210
        fi
812
80c3d9c8292f Added MODPROBE_FLAGS variable.
Florian Pose <fp@igh-essen.com>
parents: 806
diff changeset
   211
        if ! ${MODPROBE} ${MODPROBE_FLAGS} ${ECMODULE}; then
80c3d9c8292f Added MODPROBE_FLAGS variable.
Florian Pose <fp@igh-essen.com>
parents: 806
diff changeset
   212
            ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE} # try to restore module
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   213
            exit_fail
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   214
        fi
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   215
    done
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   216
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   217
    exit_success
588
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   218
    ;;
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   219
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   220
stop)
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   221
    echo -n "Shutting down EtherCAT master "
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   222
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   223
    # unload EtherCAT device modules
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   224
    for MODULE in ${DEVICE_MODULES} master; do
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   225
        ECMODULE=ec_${MODULE}
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   226
        if ! lsmod | grep -q "^${ECMODULE} "; then
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   227
            continue # ec_* module not loaded
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   228
        fi
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   229
        if ! ${RMMOD} ${ECMODULE}; then
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   230
            exit_fail
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   231
        fi;
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   232
    done
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   233
922
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   234
    # remove device nodes
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   235
    rm -f /dev/${CDEV}*
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents: 921
diff changeset
   236
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   237
    sleep 1
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   238
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   239
    # reload previous modules
588
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   240
    for MODULE in ${DEVICE_MODULES}; do
812
80c3d9c8292f Added MODPROBE_FLAGS variable.
Florian Pose <fp@igh-essen.com>
parents: 806
diff changeset
   241
        if ! ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE}; then
588
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   242
            echo Warning: Failed to restore ${MODULE}.
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   243
        fi
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   244
    done
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   245
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   246
    exit_success
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   247
    ;;
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   248
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   249
restart)
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   250
    $0 stop || exit 1
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   251
    sleep 1
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   252
    $0 start
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   253
    ;;
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   254
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   255
status)
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   256
    echo -n "Checking for EtherCAT "
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   257
588
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   258
    lsmod | grep -q "^ec_master "
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   259
    MASTERS_RUNNING=$?
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   260
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   261
    ! grep -q "(WAITING)" /sys/ethercat/master*/info
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   262
    MASTERS_IDLE=$?
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   263
ba69f7f34fbf Introduced DEVICE_MODULES variable in sysconfig file; enabled init
Florian Pose <fp@igh-essen.com>
parents: 573
diff changeset
   264
    # master module loaded and masters not waiting for devices?
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   265
    if [ ${MASTERS_RUNNING} -eq 0 -a ${MASTERS_IDLE} -eq 0 ]; then
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   266
        exit_running
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   267
    else
702
bc985819713a Fixed init script.
Florian Pose <fp@igh-essen.com>
parents: 698
diff changeset
   268
        exit_dead
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   269
    fi
573
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   270
    ;;
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   271
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   272
*)
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   273
    echo "USAGE: $0 {start|stop|restart|status}"
cdee4ea90ce9 Introduced device IDs; removed comment lines from 8139too; removed
Florian Pose <fp@igh-essen.com>
parents: 563
diff changeset
   274
    ;;
563
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   275
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   276
esac
d113b63c55c4 Changed structure of scripts subdirectory.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   277
698
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   278
if [ -r /etc/rc.status ]; then
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   279
    rc_exit
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   280
else
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   281
    exit 1
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   282
fi
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   283
6693ea7c9047 removed rc.status dependencies from init script.
Florian Pose <fp@igh-essen.com>
parents: 639
diff changeset
   284
#------------------------------------------------------------------------------