diff --git a/script/ethercat.sh b/script/ethercat.sh index 086ff1ae426a7981adead0a4f72f0e4afc58a01d..f386e1ec700ed956d0fe8be0d382854df4f85f84 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 5bb4c7ace296ca6b4cfd010d55fea262c4171802..d7949b44832d48c6ba2d22d09e3cd05d6ea8d76f 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.