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.
This commit is contained in:
Arne Fitzenreiter
2012-02-19 12:48:42 +01:00
parent 36661efeec
commit fa4762fbf8
2 changed files with 11 additions and 6 deletions

View File

@@ -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

View File

@@ -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