Fixing mirrorlist, network interfaces before reboot

This commit is contained in:
JuliusLongmind 2022-06-10 22:33:21 +02:00
parent c7a37bcd18
commit 6c421cd033
No known key found for this signature in database
GPG key ID: F006D94CA43401C3
3 changed files with 3 additions and 3 deletions

View file

@ -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>"

View file

@ -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!"

View file

@ -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"