deploy: skip status on hosts that we can not reach

This commit is contained in:
Aaron Bieber 2022-08-27 19:49:45 -06:00
parent 8779929bbe
commit 34443037fb
No known key found for this signature in database

6
deploy
View File

@ -33,7 +33,11 @@ if [ "$1" = "status" ]; then
start
for h in $(ls hosts); do
host="$(resolveAlias $h)"
echo -n "==> $h: "
if ! tsAlive $host; then
msg "can't reach ${host}.. skipping.."
continue
fi
echo -n "===> $h: "
host_data="$(${SSH} root@${host} 'nixos-version --json')"
echo -e "\t\t$(echo $host_data | jq -r .nixosVersion)\t$(echo $host_data | jq -r .configurationRevision)"
done