mirror of
https://github.com/elasticdog/packer-arch.git
synced 2026-07-17 16:36:26 +00:00
Turn network interfaces down before restart
Turning network interfaces down to make sure SSH session was dropped on host side. More info [here](https://www.packer.io/docs/provisioners/shell.html#handling-reboots)
This commit is contained in:
parent
ce539e2e6d
commit
81bb3a703c
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue