additional check for 2nd volume

This commit is contained in:
Alexander Tomokhov 2023-12-28 00:56:47 +04:00
parent 18c88f39cf
commit 91073a50a3

View file

@ -32,19 +32,22 @@ genOptionalSsh() {
EOF EOF
} }
# TODO receive disk device from outside # TODO receive disk device path from outside
determine2ndDisk() { determine2ndDisk() {
local guess rootFsDev
case "$PROVIDER" in case "$PROVIDER" in
hetzner) hetzner)
echo "/dev/sdb" guess="/dev/sdb"
;; ;;
digitalocean) digitalocean)
echo "/dev/sda" guess="/dev/sda"
;; ;;
*) *)
return 1 return 1
;; ;;
esac esac
rootFsDev="$(findmnt -no source -T /)"
[[ -b "$guess" && "$guess" != "$rootFsDev" ]] && echo "$guess"
} }
# Merge original userdata.json with deployment specific fields and print result. # Merge original userdata.json with deployment specific fields and print result.