script/init.d/ethercat
changeset 702 bc985819713a
parent 698 6693ea7c9047
child 806 ab8daaabbe48
equal deleted inserted replaced
701:aac472ccd54c 702:bc985819713a
   101 
   101 
   102 function exit_fail()
   102 function exit_fail()
   103 {
   103 {
   104     if [ -r /etc/rc.status ]; then
   104     if [ -r /etc/rc.status ]; then
   105         rc_failed
   105         rc_failed
       
   106         rc_status -v
   106         rc_exit
   107         rc_exit
   107     else
   108     else
   108         echo " failed"
   109         echo " failed"
       
   110         exit 1
       
   111     fi
       
   112 }
       
   113 
       
   114 #------------------------------------------------------------------------------
       
   115 
       
   116 function exit_dead()
       
   117 {
       
   118     if [ -r /etc/rc.status ]; then
       
   119         rc_failed
       
   120         rc_status -v
       
   121         rc_exit
       
   122     else
       
   123         echo " dead"
   109         exit 1
   124         exit 1
   110     fi
   125     fi
   111 }
   126 }
   112 
   127 
   113 #------------------------------------------------------------------------------
   128 #------------------------------------------------------------------------------
   239 
   254 
   240     # master module loaded and masters not waiting for devices?
   255     # master module loaded and masters not waiting for devices?
   241     if [ ${MASTERS_RUNNING} -eq 0 -a ${MASTERS_IDLE} -eq 0 ]; then
   256     if [ ${MASTERS_RUNNING} -eq 0 -a ${MASTERS_IDLE} -eq 0 ]; then
   242         exit_running
   257         exit_running
   243     else
   258     else
   244         exit_fail
   259         exit_dead
   245     fi
   260     fi
   246     ;;
   261     ;;
   247 
   262 
   248 *)
   263 *)
   249     echo "USAGE: $0 {start|stop|restart|status}"
   264     echo "USAGE: $0 {start|stop|restart|status}"