mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-05 21:28:48 +00:00
d462f41c8c
Co-authored-by: Nyx <144965845+nnyyxxxx@users.noreply.github.com>
34 lines
899 B
Bash
34 lines
899 B
Bash
#!/bin/sh -e
|
|
|
|
. ../common-script.sh
|
|
|
|
removeSnaps() {
|
|
if command_exists snap; then
|
|
case "$PACKAGER" in
|
|
pacman)
|
|
"$ESCALATION_TOOL" "$PACKAGER" -Rns snapd
|
|
;;
|
|
apt-get|nala)
|
|
"$ESCALATION_TOOL" "$PACKAGER" autoremove --purge snapd
|
|
if [ "$ID" = ubuntu ]; then
|
|
"$ESCALATION_TOOL" apt-mark hold snapd
|
|
fi
|
|
;;
|
|
dnf|zypper)
|
|
"$ESCALATION_TOOL" "$PACKAGER" remove snapd
|
|
;;
|
|
*)
|
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
printf "%b\n" "${GREEN}Successfully removed snaps...${RC}"
|
|
else
|
|
printf "%b\n" "${GREEN}Snapd is not installed...${RC}"
|
|
fi
|
|
}
|
|
|
|
checkEnv
|
|
checkEscalationTool
|
|
removeSnaps
|