Restart action in RC script
authorFlorian Pose <fp@igh-essen.com>
Mon, 10 Apr 2006 07:29:53 +0000
changeset 174 99907332ff1e
parent 173 10e182a8bc4e
child 175 2e4b18203ade
Restart action in RC script
ethercat.sh
--- a/ethercat.sh	Fri Apr 07 14:35:29 2006 +0000
+++ b/ethercat.sh	Mon Apr 10 07:29:53 2006 +0000
@@ -14,7 +14,7 @@
 
 print_usage()
 {
-    echo "Usage $0 { start | stop }"
+    echo "Usage: $0 { start | stop | restart }"
 }
 
 unload_module()
@@ -45,19 +45,22 @@
 fi
 
 case $ACTION in
-    start)
+    start | restart)
 	echo "Starting EtherCAT master..."
+
 	# remove modules
 	unload_module 8139too
 	unload_module 8139cp
 	unload_module ec_8139too
 	unload_module ec_master
+
 	echo "  loading master modules..."
 	if ! modprobe ec_8139too ec_device_index=$DEVICEINDEX; then
 	    echo "ERROR: Failed to load module!"
 	    exit 1
 	fi
 	;;
+
     stop)
 	echo "Stopping EtherCAT master..."
 	unload_module ec_8139too
@@ -66,6 +69,7 @@
 	    echo "Warning: Failed to restore 8139too module."
 	fi
 	;;
+
     *)
 	print_usage
 	exit 1