From 3671557429a8accf9cb737115f7e7f4b529d6cf0 Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Mon, 26 Jun 2006 15:33:18 +0000 Subject: [PATCH] EoE bridge default gateway. --- script/ethercat.sh | 17 +++++++++++++++++ script/sysconfig | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/script/ethercat.sh b/script/ethercat.sh index 086ff1ae..f386e1ec 100755 --- a/script/ethercat.sh +++ b/script/ethercat.sh @@ -141,6 +141,23 @@ case "$1" in 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 diff --git a/script/sysconfig b/script/sysconfig index 5bb4c7ac..d7949b44 100644 --- a/script/sysconfig +++ b/script/sysconfig @@ -38,6 +38,13 @@ # #EOE_IP_NETMASK=255.255.255.0 +# +# Renew default gateway after bridge installation. +# Set this to the new default gateway, if the default route shall +# be renewed after the bridge has been installed. +# +#EOE_GATEWAY=192.168.X.X + # # List of extra interfaces to include in the EoE bridge. # Set this to interconnect the EoE bridge with other local interfaces.