From 82ca92a8f970a814b8d5a171a77b099a70457a9c Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 16 Sep 2011 13:38:01 +0000 Subject: [PATCH] deployment.sh: do not hardcode eth1 for internal network configuration With the current bridge setup for installing pro systems on Proxmox we have to use ip=....:eth1:off for getting into the internet[tm]. Since the internal network device needs to be eth0 then we've to check for the specificed ip=... device and use the other[tm] one for configuration. From: Michael Prokop --- deployment.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/deployment.sh b/deployment.sh index 72b8dda..45c974d 100755 --- a/deployment.sh +++ b/deployment.sh @@ -361,12 +361,21 @@ fi # when using ip=....:$HOSTNAME:eth0:off file /etc/hosts doesn't contain the # hostname by default, avoid warning/error messages in the host system -# and use it for IP addres check in pro edition +# and use it for IP address check in pro edition +# make sure the internal device (configured later) is not statically assigned, +# since when booting with ip=....eth1:off then the internal device needs to be eth0 if checkBootParam ip ; then tmpdev=$(getBootParam ip) - case $tmpdev in *eth*) dev=$(echo $tmpdev | sed -e 's/.*:\(eth.\):.*/\1/') ;; esac + case $tmpdev in *eth*) + dev=$(echo $tmpdev | sed -e 's/.*:\(eth.\):.*/\1/') + if [[ "$dev" = "eth1" ]] ; then + INTERNAL_DEV="eth0" + fi + ;; + esac fi +[ -n "$INTERNAL_DEV" ] || INTERNAL_DEV="eth1" [ -n "$dev" ] || dev='eth0' IP="$(ifdata -pa $dev)" @@ -437,8 +446,8 @@ fi if "$PRO_EDITION" ; then # internal network on eth1 - if ifconfig eth1 &>/dev/null ; then - ifconfig eth1 $INTERNAL_IP netmask $INTERNAL_NETMASK + if ifconfig "$INTERNAL_DEV" &>/dev/null ; then + ifconfig "$INTERNAL_DEV" $INTERNAL_IP netmask $INTERNAL_NETMASK else echo "Error: no eth1 NIC found, can not deploy internal network. Exiting." >&2 exit 1