diff --git a/scripts/install-base.sh b/scripts/install-base.sh index 2ec6d95..9b26e7e 100644 --- a/scripts/install-base.sh +++ b/scripts/install-base.sh @@ -99,4 +99,8 @@ echo '==> Adding workaround for shutdown race condition' echo '==> Installation complete!' /usr/bin/sleep 3 /usr/bin/umount ${TARGET_DIR} +# Turning network interfaces down to make sure SSH session was dropped on host. +# More info at: https://www.packer.io/docs/provisioners/shell.html, section - Handling reboots +echo '==> Turning down network interfaces and rebooting' +for i in $(/usr/bin/netstat -i | /usr/bin/tail +3 | /usr/bin/awk '{print $1}'); do /usr/bin/ip link set ${i} down; done /usr/bin/systemctl reboot