Skip to content
Snippets Groups Projects
Commit 8cd60771 authored by garciadeblas's avatar garciadeblas
Browse files

installer: exit if no default iface or IP can be determined


Change-Id: Iddaefc40007c6a6a739b42f32f0a698c1682b448
Signed-off-by: default avatargarciadeblas <gerardo.garciadeblas@telefonica.com>
parent 7a5344c9
No related branches found
No related tags found
No related merge requests found
......@@ -724,7 +724,9 @@ function install_lightweight() {
LWTEMPDIR="$(mktemp -d -q --tmpdir "installosmlight.XXXXXX")"
trap 'rm -rf "${LWTEMPDIR}"' EXIT
DEFAULT_IF=`route -n |awk '$1~/^0.0.0.0/ {print $8}'`
[ -z "$DEFAULT_IF" ] && FATAL "Not possible to determine the interface with the default route 0.0.0.0"
DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF}|awk '{split($4,a,"/"); print a[1]}'`
[ -z "$DEFAULT_IP" ] && FATAL "Not possible to determine the IP address of the interface with the default route"
DEFAULT_MTU=$(ip addr show ${DEFAULT_IF} | perl -ne 'if (/mtu\s(\d+)/) {print $1;}')
if [ -z "$INSTALL_NOLXD" ]; then
need_packages_lw="lxd"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment