Update xero-plasma.sh
This commit is contained in:
parent
ccd91a488a
commit
acb07aa116
1 changed files with 20 additions and 139 deletions
159
xero-plasma.sh
159
xero-plasma.sh
|
@ -145,145 +145,26 @@ echo "Detecting if you are using a VM"
|
||||||
echo
|
echo
|
||||||
result=$(systemd-detect-virt)
|
result=$(systemd-detect-virt)
|
||||||
|
|
||||||
while [ -e "/var/lib/pacman/db.lck" ];
|
case $result in
|
||||||
do
|
oracle)
|
||||||
echo 'Pacman is not ready yet. Will try again in 5 seconds.'
|
echo "Installing virtualbox-guest-utils..."
|
||||||
seconds=$(($seconds + 5))
|
sudo pacman -S --noconfirm --needed virtualbox-guest-utils
|
||||||
sleep 5
|
;;
|
||||||
if [[ "$seconds" == "30" ]]; then
|
kvm)
|
||||||
echo 'Warning: removing pacman db.lck!'
|
echo "Installing qemu-guest-agent and spice-vdagent..."
|
||||||
rm /var/lib/pacman/db.lck
|
sudo pacman -S --noconfirm --needed qemu-guest-agent spice-vdagent qemu-hw-display-qxl xf86-video-qxl
|
||||||
fi
|
;;
|
||||||
done
|
vmware)
|
||||||
|
echo "Installing xf86-video-vmware and open-vm-tools..."
|
||||||
echo "You are working on "$result
|
sudo pacman -S --noconfirm --needed xf86-video-vmware open-vm-tools xf86-input-vmmouse
|
||||||
|
echo "Enabling vmtoolsd.service..."
|
||||||
if [ $result = "oracle" ];
|
sudo systemctl enable vmtoolsd.service
|
||||||
then
|
;;
|
||||||
#remove vmware
|
*)
|
||||||
if pacman -Qi open-vm-tools &> /dev/null; then
|
echo "You are not running in a VM."
|
||||||
systemctl disable vmtoolsd.service
|
exit 1
|
||||||
echo "Disabled vmtoolsd.service"
|
;;
|
||||||
pacman -Rns open-vm-tools --noconfirm
|
esac
|
||||||
echo "Removed open-vm-tools"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if pacman -Qi xf86-video-vmware &> /dev/null; then
|
|
||||||
pacman -Rns xf86-video-vmware --noconfirm
|
|
||||||
echo "Removed xf86-video-vmware"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /etc/systemd/system/multi-user.target.wants/vmtoolsd.service ]; then
|
|
||||||
rm /etc/systemd/system/multi-user.target.wants/vmtoolsd.service
|
|
||||||
echo "Removed vmtoolsd.service if still exists"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#remove qemu
|
|
||||||
if pacman -Qi qemu-guest-agent &> /dev/null; then
|
|
||||||
systemctl disable qemu-guest-agent.service
|
|
||||||
pacman -Rns qemu-guest-agent --noconfirm
|
|
||||||
echo "Removed qemu-guest-agent"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $result = "kvm" ];
|
|
||||||
then
|
|
||||||
#install kvm stuff
|
|
||||||
pacman -S --noconfirm qemu-guest-agent spice-vdagent
|
|
||||||
|
|
||||||
#remove vmware
|
|
||||||
if pacman -Qi open-vm-tools &> /dev/null; then
|
|
||||||
systemctl disable vmtoolsd.service
|
|
||||||
echo "Disabled vmtoolsd.service"
|
|
||||||
pacman -Rns open-vm-tools --noconfirm
|
|
||||||
echo "Removed open-vm-tools"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if pacman -Qi xf86-video-vmware &> /dev/null; then
|
|
||||||
pacman -Rns xf86-video-vmware --noconfirm
|
|
||||||
echo "Removed xf86-video-vmware"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /etc/systemd/system/multi-user.target.wants/vmtoolsd.service ]; then
|
|
||||||
rm /etc/systemd/system/multi-user.target.wants/vmtoolsd.service
|
|
||||||
echo "Removed vmtoolsd.service if still exists"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#remove virtualbox
|
|
||||||
if pacman -Qi virtualbox-guest-utils &> /dev/null; then
|
|
||||||
systemctl disable vboxservice.service
|
|
||||||
pacman -Rns virtualbox-guest-utils --noconfirm
|
|
||||||
echo "Removed virtualbox-guest-utils"
|
|
||||||
fi
|
|
||||||
if pacman -Qi virtualbox-guest-utils-nox &> /dev/null; then
|
|
||||||
systemctl disable vboxservice.service
|
|
||||||
pacman -Rns virtualbox-guest-utils-nox --noconfirm
|
|
||||||
echo "Removed virtualbox-guest-utils-nox"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $result = "vmware" ];
|
|
||||||
then
|
|
||||||
#remove virtualbox
|
|
||||||
if pacman -Qi virtualbox-guest-utils &> /dev/null; then
|
|
||||||
systemctl disable vboxservice.service
|
|
||||||
pacman -Rns virtualbox-guest-utils --noconfirm
|
|
||||||
echo "Removed virtualbox-guest-utils"
|
|
||||||
fi
|
|
||||||
if pacman -Qi virtualbox-guest-utils-nox &> /dev/null; then
|
|
||||||
systemctl disable vboxservice.service
|
|
||||||
pacman -Rns virtualbox-guest-utils-nox --noconfirm
|
|
||||||
echo "Removed virtualbox-guest-utils-nox"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#remove qemu
|
|
||||||
if pacman -Qi qemu-guest-agent &> /dev/null; then
|
|
||||||
systemctl disable qemu-guest-agent.service
|
|
||||||
pacman -Rns qemu-guest-agent --noconfirm
|
|
||||||
echo "Removed qemu-guest-agent"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $result = "none" ];
|
|
||||||
then
|
|
||||||
#remove virtualbox
|
|
||||||
if pacman -Qi virtualbox-guest-utils &> /dev/null; then
|
|
||||||
systemctl disable vboxservice.service
|
|
||||||
pacman -Rns virtualbox-guest-utils --noconfirm
|
|
||||||
echo "Removed virtualbox-guest-utils"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if pacman -Qi virtualbox-guest-utils-nox &> /dev/null; then
|
|
||||||
systemctl disable vboxservice.service
|
|
||||||
pacman -Rns virtualbox-guest-utils-nox --noconfirm
|
|
||||||
echo "Removed virtualbox-guest-utils-nox"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#remove vmware
|
|
||||||
if pacman -Qi open-vm-tools &> /dev/null; then
|
|
||||||
systemctl disable vmtoolsd.service
|
|
||||||
echo "Disabled vmtoolsd.service"
|
|
||||||
pacman -Rns open-vm-tools --noconfirm
|
|
||||||
echo "Removed open-vm-tools"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if pacman -Qi xf86-video-vmware &> /dev/null; then
|
|
||||||
pacman -Rns xf86-video-vmware --noconfirm
|
|
||||||
echo "Removed xf86-video-vmware"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /etc/systemd/system/multi-user.target.wants/vmtoolsd.service ]; then
|
|
||||||
rm /etc/systemd/system/multi-user.target.wants/vmtoolsd.service
|
|
||||||
echo "Removed vmtoolsd.service if still exists"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#remove qemu
|
|
||||||
if pacman -Qi qemu-guest-agent &> /dev/null; then
|
|
||||||
systemctl disable qemu-guest-agent.service
|
|
||||||
pacman -Rns qemu-guest-agent --noconfirm
|
|
||||||
echo "Removed qemu-guest-agent"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
echo
|
echo
|
||||||
echo "#############################################"
|
echo "#############################################"
|
||||||
echo " Done, now exit and reboot "
|
echo " Done, now exit and reboot "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue