more detection improvements

This commit is contained in:
Jason Ertel
2023-05-02 07:57:49 -04:00
parent 6c151d3ebd
commit 40ff2677c4

View File

@@ -917,12 +917,16 @@ create_repo() {
logCmd "createrepo /nsm/repo"
}
detect_cloud() {
info "Testing if setup is running on a cloud instance..."
if dmidecode -s bios-version | grep -q amazon || \
dmidecode -s bios-vendor | grep -q Amazon || \
dmidecode -s bios-vendor | grep -q Google || \
[ -f /var/log/waagent.log ]; then
info "Detected a cloud installation..." && export is_cloud="true";
info "Detected a cloud installation..."
export is_cloud="true"
else
info "This does not appear to be a cloud installation."
fi