script/init.d/ethercat
changeset 812 80c3d9c8292f
parent 806 ab8daaabbe48
child 921 c8c2caf0d667
equal deleted inserted replaced
811:741cabf0fff6 812:80c3d9c8292f
   173 
   173 
   174         MASTER_INDEX=$(expr ${MASTER_INDEX} + 1)
   174         MASTER_INDEX=$(expr ${MASTER_INDEX} + 1)
   175     done
   175     done
   176 
   176 
   177     # load master module
   177     # load master module
   178     if ! ${MODPROBE} ec_master main_devices=${DEVICES} backup_devices=${BACKUPS}; then
   178     if ! ${MODPROBE} ${MODPROBE_FLAGS} ec_master \
       
   179             main_devices=${DEVICES} backup_devices=${BACKUPS}; then
   179         exit_fail
   180         exit_fail
   180     fi
   181     fi
   181 
   182 
   182     # remove stale device node
   183     # remove stale device node
   183     rm -f /dev/${XMLDEVICE}0
   184     rm -f /dev/${XMLDEVICE}0
   197         if lsmod | grep "^${MODULE} " > /dev/null; then
   198         if lsmod | grep "^${MODULE} " > /dev/null; then
   198             if ! ${RMMOD} ${MODULE}; then
   199             if ! ${RMMOD} ${MODULE}; then
   199                 exit_fail
   200                 exit_fail
   200             fi
   201             fi
   201         fi
   202         fi
   202         if ! ${MODPROBE} ${ECMODULE}; then
   203         if ! ${MODPROBE} ${MODPROBE_FLAGS} ${ECMODULE}; then
   203             ${MODPROBE} ${MODULE} # try to restore module
   204             ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE} # try to restore module
   204             exit_fail
   205             exit_fail
   205         fi
   206         fi
   206     done
   207     done
   207 
   208 
   208     exit_success
   209     exit_success
   227 
   228 
   228     sleep 1
   229     sleep 1
   229 
   230 
   230     # reload previous modules
   231     # reload previous modules
   231     for MODULE in ${DEVICE_MODULES}; do
   232     for MODULE in ${DEVICE_MODULES}; do
   232         if ! ${MODPROBE} ${MODULE}; then
   233         if ! ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE}; then
   233             echo Warning: Failed to restore ${MODULE}.
   234             echo Warning: Failed to restore ${MODULE}.
   234         fi
   235         fi
   235     done
   236     done
   236 
   237 
   237     exit_success
   238     exit_success