script/init.d/ethercat.in
branchstable-1.4
changeset 1682 d80f4ecd073e
parent 1190 5f2e38dddd4e
child 1326 ef907b0b5125
equal deleted inserted replaced
1681:6e8477e16eec 1682:d80f4ecd073e
    69 
    69 
    70 . ${ETHERCAT_CONFIG}
    70 . ${ETHERCAT_CONFIG}
    71 
    71 
    72 #------------------------------------------------------------------------------
    72 #------------------------------------------------------------------------------
    73 
    73 
    74 function exit_success()
    74 exit_success() {
    75 {
       
    76     if [ -r /etc/rc.status ]; then
    75     if [ -r /etc/rc.status ]; then
    77         rc_reset
    76         rc_reset
    78         rc_status -v
    77         rc_status -v
    79         rc_exit
    78         rc_exit
    80     else
    79     else
    83     fi
    82     fi
    84 }
    83 }
    85 
    84 
    86 #------------------------------------------------------------------------------
    85 #------------------------------------------------------------------------------
    87 
    86 
    88 function exit_fail()
    87 exit_fail() {
    89 {
       
    90     if [ -r /etc/rc.status ]; then
    88     if [ -r /etc/rc.status ]; then
    91         rc_failed
    89         rc_failed
    92         rc_status -v
    90         rc_status -v
    93         rc_exit
    91         rc_exit
    94     else
    92     else
    97     fi
    95     fi
    98 }
    96 }
    99 
    97 
   100 #------------------------------------------------------------------------------
    98 #------------------------------------------------------------------------------
   101 
    99 
   102 function print_running()
   100 print_running() {
   103 {
       
   104     if [ -r /etc/rc.status ]; then
   101     if [ -r /etc/rc.status ]; then
   105         rc_reset
   102         rc_reset
   106         rc_status -v
   103         rc_status -v
   107     else
   104     else
   108         echo " running"
   105         echo " running"
   109     fi
   106     fi
   110 }
   107 }
   111 
   108 
   112 #------------------------------------------------------------------------------
   109 #------------------------------------------------------------------------------
   113 
   110 
   114 function print_dead()
   111 print_dead() {
   115 {
       
   116     if [ -r /etc/rc.status ]; then
   112     if [ -r /etc/rc.status ]; then
   117         rc_failed
   113         rc_failed
   118         rc_status -v
   114         rc_status -v
   119     else
   115     else
   120         echo " dead"
   116         echo " dead"
   121     fi
   117     fi
   122 }
   118 }
   123 
   119 
   124 #------------------------------------------------------------------------------
   120 #------------------------------------------------------------------------------
   125 
   121 
   126 function parse_mac_address()
   122 parse_mac_address() {
   127 {
       
   128     if [ -z "${1}" ]; then
   123     if [ -z "${1}" ]; then
   129         MAC=""
   124         MAC=""
   130     elif echo ${1} | grep -qE '^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$'; then
   125     elif echo ${1} | grep -qE '^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$'; then
   131         MAC=${1}
   126         MAC=${1}
   132     else
   127     else