diff -r af21f0bdc7c9 -r 2b9c78543663 script/ethercatctl.in --- a/script/ethercatctl.in Thu Sep 06 14:21:02 2012 +0200 +++ b/script/ethercatctl.in Mon Nov 03 15:20:05 2014 +0100 @@ -33,6 +33,7 @@ # #------------------------------------------------------------------------------ +LSMOD=/sbin/lsmod MODPROBE=/sbin/modprobe RMMOD=/sbin/rmmod MODINFO=/sbin/modinfo @@ -107,9 +108,9 @@ continue # ec_* module not found fi - if [ ${MODULE} != "generic" ]; then + if [ ${MODULE} != "generic" -a ${MODULE} != "ccat" ]; then # try to unload standard module - if lsmod | grep "^${MODULE} " > /dev/null; then + if ${LSMOD} | grep "^${MODULE} " > /dev/null; then if ! ${RMMOD} ${MODULE}; then ${RMMOD} ${LOADED_MODULES} exit 1 @@ -118,7 +119,7 @@ fi if ! ${MODPROBE} ${MODPROBE_FLAGS} ${ECMODULE}; then - if [ ${MODULE} != "generic" ]; then + if [ ${MODULE} != "generic" -a ${MODULE} != "ccat" ]; then ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE} # try to restore fi ${RMMOD} ${LOADED_MODULES} @@ -137,7 +138,7 @@ # unload EtherCAT device modules for MODULE in ${DEVICE_MODULES} master; do ECMODULE=ec_${MODULE} - if ! lsmod | grep -q "^${ECMODULE} "; then + if ! ${LSMOD} | grep -q "^${ECMODULE} "; then continue # ec_* module not loaded fi if ! ${RMMOD} ${ECMODULE}; then @@ -149,7 +150,7 @@ # load standard modules again for MODULE in ${DEVICE_MODULES}; do - if [ ${MODULE} == "generic" ]; then + if [ ${MODULE} == "generic" -o ${MODULE} == "ccat" ]; then continue fi ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE}