added check for vm or lxc for qemu-guest-agent

This commit is contained in:
2023-10-18 12:43:16 -05:00
parent 7986af17df
commit f913f4711e
2 changed files with 31 additions and 3 deletions

View File

@@ -18,8 +18,22 @@ apt-get remove os-prober -y
apt-get update
apt-get upgrade -y
# check if vm or lxc
if [[ ! -d /dev/disk/by-id ]]
then
apt-get install -y qemu-guest-agent
else
isInFile=$(ls /dev/disk/by-id | grep -c "QEMU")
if [ $isInFile -eq 0 ]
then
apt-get remove -y qemu-guest-agent
else
apt-get install -y qemu-guest-agent
fi
fi
# download and install packages
apt-get install -y ncdu pwgen qemu-guest-agent sudo nano curl wget zip unzip git rsync man-db cifs-utils nfs-common parted libtalloc2 libwbclient0 net-tools gnupg apt-transport-https tmux gdisk bash-completion
apt-get install -y ncdu pwgen sudo nano curl wget zip unzip git rsync man-db cifs-utils nfs-common parted libtalloc2 libwbclient0 net-tools gnupg apt-transport-https tmux gdisk bash-completion
# add akanealw user if not existing
isInFile=$(cat /etc/passwd | grep -c "akanealw")