From fa4762fbf8732a1e48015ee07a422f293d7be1f7 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Sun, 19 Feb 2012 12:48:42 +0100 Subject: [PATCH] network: don't set ip address "1.1.1.1". This change made also green-only with dhcp possible. configure green to 1.1.1.1 and red to dhcp client and RED_DEV=green0. --- config/rootfiles/core/57/filelists/files | 1 + src/initscripts/init.d/networking/any | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/config/rootfiles/core/57/filelists/files b/config/rootfiles/core/57/filelists/files index a678ee8e7f..2f80b5f568 100644 --- a/config/rootfiles/core/57/filelists/files +++ b/config/rootfiles/core/57/filelists/files @@ -2,3 +2,4 @@ etc/system-release etc/issue etc/rc.d/init.d/networking/red.up/10-static-routes etc/rc.d/init.d/networking/red.down/10-static-routes +etc/rc.d/init.d/networking/any diff --git a/src/initscripts/init.d/networking/any b/src/initscripts/init.d/networking/any index b88d21ecf7..5609a9efe9 100644 --- a/src/initscripts/init.d/networking/any +++ b/src/initscripts/init.d/networking/any @@ -80,15 +80,19 @@ case "${1}" in # Create & Enable vnstat data collection /usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1 - boot_mesg "Adding IPv4 address ${ADDRESS} to the ${DEVICE} interface..." - ip addr add ${args} dev ${DEVICE} - evaluate_retval + if [ ! "${ADDRESS}" == "1.1.1.1" ]; then + boot_mesg "Adding IPv4 address ${ADDRESS} to the ${DEVICE} interface..." + ip addr add ${args} dev ${DEVICE} + evaluate_retval + fi ;; stop) - boot_mesg "Removing IPv4 addresses from the ${DEVICE} interface..." - ip addr flush dev ${DEVICE} - evaluate_retval + if [ ! "${ADDRESS}" == "1.1.1.1" ]; then + boot_mesg "Removing IPv4 addresses from the ${DEVICE} interface..." + ip addr flush dev ${DEVICE} + evaluate_retval + fi # Disable vnstat collection /usr/bin/vnstat -u -i ${DEVICE} -r --disable > /dev/null 2>&1 -- 2.39.2