projects
/
hvlinux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branche make
[hvlinux.git]
/
stage2
/
bootscripts
/
ifup
diff --git
a/stage2/bootscripts/ifup
b/stage2/bootscripts/ifup
index
7f7d15f
..
b8fc5e8
100755
(executable)
--- a/
stage2/bootscripts/ifup
+++ b/
stage2/bootscripts/ifup
@@
-23,8
+23,14
@@
check_brctl()
fi
}
fi
}
+# First make sure interface is available
+if ! ip link show ${DEVICE} ; then
+ echo "Interface ${DEVICE} not available"
+ exit ${EXIT_CODE_WARNING}
+fi
+
# Determining if the interface is a bridge:
# 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
check_brctl
cmd_run_log ${BRCTL} addbr ${1} &&
cmd_run_log ${BRCTL} stp ${1} off || exit 1
@@
-57,6
+63,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
# 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
elif [ x${BOOTPROTO} = "xpppoe" ]; then
# PPPoE configuration
cmd_run_log pppoe-start