Skip to content

Commit

Permalink
Unattended upgrades: Add hypervisor detection
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Mar 30, 2022
1 parent 6c8fd8d commit 3775112
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions debian-enable-unattended-upgrades.sh
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ function activate_repository {
add_line "${line}"
}

function is_empty() {
# https://superuser.com/a/1284256
test -z $(find "$1" -mindepth 1 -printf X -quit)
}

function is_hypervisor() {
($(is_empty /proc/xen 2> /dev/null) && $(test ! -e /dev/kvm)) && return 1 || return 0
}


# ------------------
Expand Down

0 comments on commit 3775112

Please sign in to comment.