X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage2%2Fbootscripts%2Fifup;h=4224c473b4fa112bf77e12f570fc5f46e738e203;hb=907fcfdccdd0ddd33accef87490f9e0b750797ad;hp=7f7d15f246f80383408e69ac49dfd492d7979f0e;hpb=16cc35ba4890382ee9368a176e4f5a7fa773b7a6;p=hvlinux.git diff --git a/stage2/bootscripts/ifup b/stage2/bootscripts/ifup index 7f7d15f..4224c47 100755 --- a/stage2/bootscripts/ifup +++ b/stage2/bootscripts/ifup @@ -24,7 +24,7 @@ check_brctl() } # Determining if the interface is a bridge: -if [ "x${BRIDGE}" == "xyes" ]; then +if [ "x${BRIDGE}" = "xyes" ]; then check_brctl cmd_run_log ${BRCTL} addbr ${1} && cmd_run_log ${BRCTL} stp ${1} off || exit 1 @@ -57,6 +57,15 @@ elif [ x${BOOTPROTO} = "xstatic" ]; then # Static configuration cmd_run_log ip addr add ${IPADDR}/${PREFIX_LENGTH} dev ${DEVICE} brd + ${IFSCOPE} && cmd_run_log ip link set ${DEVICE} up + + if [ -n "${GATEWAY}" ]; then + if ip route | grep -q default; then + msg_log "Gateway already setup; skipping." + else + cmd_run_log_box "Adding default route to gateway ${GATEWAY}" \ + ip route add default via ${GATEWAY} dev ${DEVICE} + fi + fi elif [ x${BOOTPROTO} = "xpppoe" ]; then # PPPoE configuration cmd_run_log pppoe-start