mirror of
https://github.com/elasticdog/packer-arch.git
synced 2026-07-17 16:36:26 +00:00
Fixing mirrorlist, network interfaces before reboot
This commit is contained in:
parent
c7a37bcd18
commit
6c421cd033
3 changed files with 3 additions and 3 deletions
|
|
@ -83,7 +83,7 @@
|
|||
"http_directory": "srv",
|
||||
"boot_wait": "5s",
|
||||
"boot_command": [
|
||||
"<enter><wait10><wait10><wait10><wait10>",
|
||||
"<enter><wait10><wait10><wait10><wait10><wait10><wait10>",
|
||||
"/usr/bin/curl -O http://{{ .HTTPIP }}:{{ .HTTPPort }}/enable-ssh.sh<enter><wait5>",
|
||||
"/usr/bin/curl -O http://{{ .HTTPIP }}:{{ .HTTPPort }}/poweroff.timer<enter><wait5>",
|
||||
"/usr/bin/bash ./enable-ssh.sh<enter>"
|
||||
|
|
|
|||
|
|
@ -120,6 +120,6 @@ echo ">>>> install-base.sh: Completing installation.."
|
|||
# Turning network interfaces down to make sure SSH session was dropped on host.
|
||||
# More info at: https://www.packer.io/docs/provisioners/shell.html#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
|
||||
for i in $(/usr/bin/ip -o link show | /usr/bin/awk -F': ' '{print $2}'); do /usr/bin/ip link set ${i} down; done
|
||||
/usr/bin/systemctl reboot
|
||||
echo ">>>> install-base.sh: Installation complete!"
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ fi
|
|||
|
||||
if [[ $country ]]; then
|
||||
if validate_country "$country"; then
|
||||
MIRRORLIST="https://www.archlinux.org/mirrorlist/?country=${country}&protocol=http&protocol=https&ip_version=4&use_mirror_status=on"
|
||||
MIRRORLIST="https://archlinux.org/mirrorlist/?country=${country}&protocol=http&protocol=https&ip_version=4&use_mirror_status=on"
|
||||
MIRROR=$(curl -s "$MIRRORLIST" | awk '/#Server/{ print $3; exit }' | sed 's|/$repo.*||')
|
||||
else
|
||||
warn 'INVALID COUNTRY SPECIFIED - %s' "$country"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue