unlicense

This commit is contained in:
Retro Sapphire
2022-02-13 18:36:53 +05:30
parent d8a51fbce3
commit fcdfc8d1b0
3 changed files with 90 additions and 2 deletions
+42 -2
View File
@@ -1,12 +1,43 @@
#!/bin/bash
if [[ "$EUID" == 0 ]]
then
cat << EOF
┌──────────────────────────────────────────────────────────────────────┐
│Please don't run this script as root as it may break you system. │
│We will ask you for the password if we need root access. │
└──────────────────────────────────────────────────────────────────────┘
┬─┬ ( ゜-゜ノ)
EOF
exit
fi
cat << EOF
┌──────────────────────────────────────────────────────────────────────┐
│This Bash Script is made by u/Techno021 to nuke snaps from Ubuntu. │
│ │
│Note: This has only been tested on Ubuntu 20.04 LTS, and may not work │
│as intended on other versions. I will not be responsible for any │
│damage if this script breaks your pc │
└──────────────────────────────────────────────────────────────────────┘
EOF
while true; do
read -p "Do you wish to run the script? " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
sudo snap remove $(snap list | awk '!/^Name|^core|^bare|^snapd/ {print $1}')
sudo snap remove $(snap list | awk '/^bare/ {print $1}')
sudo snap remove $(snap list | awk '/^core/ {print $1}')
sudo snap remove $(snap list | awk '/^snapd/ {print $1}')
for VARIABLE in $(df -h | awk '/snap/ {print $6}')
for I in $(df -h | awk '/snap/ {print $6}')
do
sudo umount $VARIABLE
sudo umount $I
done
sudo cp nosnap.pref /etc/apt/preferences.d/nosnap.pref
@@ -16,3 +47,12 @@ rm -rf ~/snap
sudo rm -rf /snap
sudo rm -rf /var/snap
sudo rm -rf /var/lib/snapd
cat << EOF
┌─────────────────────────────────────────────────────────────────────┐
│All Done! This script has succesfully completed, please reboot so │
│that changes take effect. │
└─────────────────────────────────────────────────────────────────────┘
(╯°□°)╯︵ ┴─┴
EOF
echo