diff --git a/debian/debian-essentials.sh b/debian/debian-essentials.sh index 874985f..50d558d 100755 --- a/debian/debian-essentials.sh +++ b/debian/debian-essentials.sh @@ -50,6 +50,20 @@ apt-get remove os-prober -y > /dev/null 2>&1 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 lsb-release cron 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 @@ -223,7 +237,7 @@ if [ $isInFile -eq 0 ] rm /opt/cronicle/conf/config.json wget -qO /opt/cronicle/conf/config.json http://192.168.1.50/files/debian/cronicle-config.json /opt/cronicle/bin/control.sh start - echo "Cronicle worker is installed." + echo "Cronicle worker installed." else - echo "Cronicle worker is already installed." + echo "Cronicle worker already installed." fi diff --git a/ubuntu/ubuntu-essentials.sh b/ubuntu/ubuntu-essentials.sh index bbc5987..144249c 100755 --- a/ubuntu/ubuntu-essentials.sh +++ b/ubuntu/ubuntu-essentials.sh @@ -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")