46 lines
1.2 KiB
Bash
Executable File
46 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
#echo "I am in ${0}"
|
|
|
|
# skip this file for debian 10
|
|
if [ "$EPICS_HOST_ARCH" = "deb10-x86_64" ]; then
|
|
exit
|
|
fi
|
|
|
|
ETHCATPCKGE="/ioc/NeedfulThings/EtherCAT/install-packages/ethercat-1.6.3-$(uname -r)-drv.deb"
|
|
if [ ! -f "${ETHCATPCKGE}" ]
|
|
then
|
|
echo "${ETHCATPCKGE} does not exist"
|
|
exit
|
|
else
|
|
if [ ! -r "${ETHCATPCKGE}" ]
|
|
then
|
|
echo "${ETHCATPCKGE} is NOT readable"
|
|
exit
|
|
else
|
|
echo "Will install ${ETHCATPCKGE}"
|
|
fi
|
|
fi
|
|
|
|
#udevadm control --log-priority=debug
|
|
|
|
# this is probably not needed, because it did not start (package was missing)
|
|
systemctl stop ethercat # stop if already running
|
|
|
|
# install package
|
|
dpkg -i ${ETHCATPCKGE} > /tmp/ethercat-install.log
|
|
|
|
# service housekeeping
|
|
systemctl daemon-reload # if ethercat.service was already there
|
|
systemctl enable ethercat # if ethercat.service was not enabled
|
|
|
|
# start ethercat service
|
|
systemctl start ethercat # start (again)
|
|
|
|
echo "ls -l /dev/EtherCAT*"; ls -l /dev/EtherCAT*
|
|
sleep 1
|
|
udevadm trigger # make /dev/EtherCAT* rw for all: why I need this on some systems, and on some other not
|
|
echo "ls -l /dev/EtherCAT*"; ls -l /dev/EtherCAT*
|
|
sleep 1
|
|
echo "ls -l /dev/EtherCAT*"; ls -l /dev/EtherCAT*
|