From ffec27796bcf61e8e873e3f69919842c7d76567b Mon Sep 17 00:00:00 2001 From: Matthew Fisher Date: Sat, 31 Aug 2024 21:30:27 -0500 Subject: [PATCH] Add Onboarding/xe-utils-install.sh --- Onboarding/xe-utils-install.sh | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Onboarding/xe-utils-install.sh diff --git a/Onboarding/xe-utils-install.sh b/Onboarding/xe-utils-install.sh new file mode 100644 index 0000000..7acbe9f --- /dev/null +++ b/Onboarding/xe-utils-install.sh @@ -0,0 +1,45 @@ + #!/bin/bash + +# Check if root +if [ $(whoami) != 'root' ]; then + echo "Please run as root." + exit 1 +else + echo "root check complete." +fi + +cd /tmp + +#Check OS Version +case $(cat /etc/os-release | grep ^ID= | sed -e "s/^ID=//") in + "debian") + wget http://config.lan.fisherhome.xyz/xe-utils/xe-guest-utilities_8.4.0-1_amd64.deb + dpkg -i *.deb + success=true + ;; + "ubuntu") + wget http://config.lan.fisherhome.xyz/xe-utils/xe-guest-utilities_8.4.0-1_amd64.deb + dpkg -i *.deb + success=true + ;; + '"almalinux"') + wget http://config.lan.fisherhome.xyz/xe-utils/xe-guest-utilities-8.4.0-1.x86_64.rpm + wget http://config.lan.fisherhome.xyz/xe-utils/xe-guest-utilities-xenstore-8.4.0-1.x86_64.rpm + dnf install -y *.rpm + success=true + ;; + *) + echo "Uknown OS Type. Exiting" + success=false + ;; +esac + +if [ $success = true ]; then + echo "Installation complete rebooting in 3 seconds." + sleep 1 + echo "2.." + sleep 1 + echo "1..." + sleep 1 + reboot now +fi \ No newline at end of file