simplify deployment script usage

This commit is contained in:
Daniel Micay 2024-06-17 18:29:28 -04:00
parent 750cd5e985
commit d103f6cdf3
3 changed files with 66 additions and 7 deletions

View file

@ -3,10 +3,18 @@
set -o errexit -o nounset -o pipefail
. hosts.sh
. deploy.sh
[[ $# -eq 1 ]] || exit 1
readonly host=$1
readonly ip=${hosts_ipv4_address[$host]}
readonly hostname=${hosts_hostname[$host]}
readonly agcount=${hosts_agcount[$host]:-4}
readonly swap=${hosts_agcount[$host]:-2048}
readonly remote=root@$ip
readonly drive=$(ssh $remote '[[ -e /dev/sda ]] && echo sda || echo vda')
# check for Arch ISO
ssh $remote '[[ $(grep IMAGE_ID /etc/os-release) = "IMAGE_ID=archlinux" ]]' || exit 5
ssh $remote '[[ $(grep IMAGE_VERSION /etc/os-release) = "IMAGE_VERSION=2024.06.01" ]]' || exit 5