Skip to content
Snippets Groups Projects
Commit 5c3544d8 authored by Florian Pose's avatar Florian Pose
Browse files

Restart action in RC script

parent de081fc4
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ CONFIGFILE=/etc/sysconfig/ethercat ...@@ -14,7 +14,7 @@ CONFIGFILE=/etc/sysconfig/ethercat
print_usage() print_usage()
{ {
echo "Usage $0 { start | stop }" echo "Usage: $0 { start | stop | restart }"
} }
unload_module() unload_module()
...@@ -45,19 +45,22 @@ else ...@@ -45,19 +45,22 @@ else
fi fi
case $ACTION in case $ACTION in
start) start | restart)
echo "Starting EtherCAT master..." echo "Starting EtherCAT master..."
# remove modules # remove modules
unload_module 8139too unload_module 8139too
unload_module 8139cp unload_module 8139cp
unload_module ec_8139too unload_module ec_8139too
unload_module ec_master unload_module ec_master
echo " loading master modules..." echo " loading master modules..."
if ! modprobe ec_8139too ec_device_index=$DEVICEINDEX; then if ! modprobe ec_8139too ec_device_index=$DEVICEINDEX; then
echo "ERROR: Failed to load module!" echo "ERROR: Failed to load module!"
exit 1 exit 1
fi fi
;; ;;
stop) stop)
echo "Stopping EtherCAT master..." echo "Stopping EtherCAT master..."
unload_module ec_8139too unload_module ec_8139too
...@@ -66,6 +69,7 @@ case $ACTION in ...@@ -66,6 +69,7 @@ case $ACTION in
echo "Warning: Failed to restore 8139too module." echo "Warning: Failed to restore 8139too module."
fi fi
;; ;;
*) *)
print_usage print_usage
exit 1 exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment