# HG changeset patch # User Florian Pose # Date 1404811082 -7200 # Node ID 0d978e56a635ed93cd9c4ae4948f2af8cf43772d # Parent 8dd49f6f6d325857557ccc8478b354f4179f6288 Use absolute path fpr ldmod; thanks to S. Blanchet. diff -r 8dd49f6f6d32 -r 0d978e56a635 script/ethercatctl.in --- a/script/ethercatctl.in Mon May 05 13:55:00 2014 +0200 +++ b/script/ethercatctl.in Tue Jul 08 11:18:02 2014 +0200 @@ -33,6 +33,7 @@ # #------------------------------------------------------------------------------ +LSMOD=/sbin/lsmod MODPROBE=/sbin/modprobe RMMOD=/sbin/rmmod MODINFO=/sbin/modinfo @@ -109,7 +110,7 @@ if [ ${MODULE} != "generic" ]; 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 @@ -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 diff -r 8dd49f6f6d32 -r 0d978e56a635 script/init.d/ethercat.in --- a/script/init.d/ethercat.in Mon May 05 13:55:00 2014 +0200 +++ b/script/init.d/ethercat.in Tue Jul 08 11:18:02 2014 +0200 @@ -47,6 +47,7 @@ #------------------------------------------------------------------------------ +LSMOD=/sbin/lsmod MODPROBE=/sbin/modprobe RMMOD=/sbin/rmmod MODINFO=/sbin/modinfo @@ -177,7 +178,7 @@ continue # ec_* module not found fi if [ ${MODULE} != "generic" ]; then - if lsmod | grep "^${MODULE} " > /dev/null; then + if ${LSMOD} | grep "^${MODULE} " > /dev/null; then if ! ${RMMOD} ${MODULE}; then exit_fail fi @@ -200,7 +201,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