script/ethercat.sh
branchstable-1.0
changeset 1622 fe8777a69d4a
parent 1621 4bbe090553f7
child 1624 9dc190591c0f
--- a/script/ethercat.sh	Mon Jun 26 15:04:06 2006 +0000
+++ b/script/ethercat.sh	Mon Jun 26 15:35:23 2006 +0000
@@ -141,6 +141,23 @@
 			rc_status -v
 			rc_exit
 		fi
+
+		# install new default gateway
+		if [ -n "$EOE_GATEWAY" ]; then
+			while /sbin/route -n | grep -E -q "^0.0.0.0"; do
+				if ! /sbin/route del default; then
+					echo "Failed to remove default route!" 1>&2
+					/bin/false
+					rc_status -v
+					rc_exit
+				fi
+			done
+			if ! /sbin/route add default gw $EOE_GATEWAY; then
+				/bin/false
+				rc_status -v
+				rc_exit
+			fi
+		fi
 	fi
 
 	rc_status -v