Add a nice error message to ethercatctl in case of missing config.

This commit is contained in:
Bjarne von Horn 2023-11-07 11:44:24 +01:00
parent 722b2d607c
commit 55e77f964d
1 changed files with 8 additions and 0 deletions

View File

@ -102,6 +102,14 @@ start)
MASTER_INDEX=$((${MASTER_INDEX} + 1))
done
if [ -z "${DEVICES}" ]; then
echo "ERROR: No network cards for EtherCAT specified."
echo -n "Please edit ${ETHERCAT_CONFIG} with root permissions"
echo -n " and set MASTER0_DEVICE variable to either a "
echo "network interface name (like eth0) or to a MAC address."
exit 1
fi
# load master module
if ! ${MODPROBE} ${MODPROBE_FLAGS} ec_master \
main_devices="${DEVICES}" backup_devices="${BACKUPS}"; then