deployment: restart networking after grabbing /etc/network/interfaces via REST API

Now having verified that it works in toram mode when booting via NFS/PXE

From: Michael Prokop <mprokop@sipwise.com>
ksolomko/vlan
Michael Prokop 13 years ago
parent 899d3c7f65
commit 51b63b519d

@ -913,20 +913,30 @@ if "$RETRIEVE_MGMT_CONFIG" ; then
cp /etc/network/interfaces "${TARGET}/etc/network/interfaces" cp /etc/network/interfaces "${TARGET}/etc/network/interfaces"
# make sure we can access the management system which might be reachable # restart networking for the time being only when running either in toram mode
# through a specific VLAN only # or not booting from NFS, once we've finished the carrier setup procedure we
ip link set dev "$INTERNAL_DEV" down # avoid conflicts with VLAN device(s) # should be able to make this as our only supported default mode and drop
# everything inside the 'else' statement...
# vlan-raw-device b0 doesn't exist in the live environment, if we don't if grep -q 'toram' /proc/cmdline || ! grep -q 'root=/dev/nfs' /proc/cmdline ; then
# adjust it accordingly for our environment the vlan device(s) can't be echo 'Restarting networking'
# brought up logit 'Restarting networking'
# note: we do NOT modify the /e/n/i file from $TARGET here by intention /etc/init.d/networking restart
sed -i "s/vlan-raw-device .*/vlan-raw-device eth0/" /etc/network/interfaces else
# make sure we can access the management system which might be reachable
for interface in $(awk '/^auto vlan/ {print $2}' /etc/network/interfaces) ; do # through a specific VLAN only
echo "Bringing up VLAN interface $interface" ip link set dev "$INTERNAL_DEV" down # avoid conflicts with VLAN device(s)
ifup "$interface"
done # vlan-raw-device b0 doesn't exist in the live environment, if we don't
# adjust it accordingly for our environment the vlan device(s) can't be
# brought up
# note: we do NOT modify the /e/n/i file from $TARGET here by intention
sed -i "s/vlan-raw-device .*/vlan-raw-device eth0/" /etc/network/interfaces
for interface in $(awk '/^auto vlan/ {print $2}' /etc/network/interfaces) ; do
echo "Bringing up VLAN interface $interface"
ifup "$interface"
done
fi # toram
fi fi

Loading…
Cancel
Save