You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Botspot-Pi-Apps/apps/Minecraft Pi (Modded)/uninstall

32 lines
732 B
Bash

#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\\e[91m$1\\e[39m"
exit 1
}
# Wait for apt lock to be released
i=0
while sudo fuser /var/{lib/{dpkg,apt/lists},cache/apt/archives}/lock > /dev/null 2>&1
do
case $(($i % 4)) in
0) j="-";;
1) j="\\";;
2) j="|";;
3) j="/";;
esac
printf "\r[$j] Waiting for other package managers to finish..."
sleep 0.5
((i+=1))
done
[[ $i -gt 0 ]] && printf "Done.\n"
sudo apt remove -y minecraft-pi-reborn-native &>/dev/null || true
"${DIRECTORY}/purge-installed" "$(dirname "$0")" || exit 1
sudo apt -y autoremove
sudo rm -f /etc/apt/{sources.list,trusted.gpg}.d/mcpi-revival.{list,gpg}