22 lines
444 B
Bash
22 lines
444 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# Function to remove a file or directory if it exists
|
||
|
remove_if_exists() {
|
||
|
if [ -e "$1" ]; then
|
||
|
rm -rf "$1"
|
||
|
echo "Removed $1"
|
||
|
else
|
||
|
echo "$1 does not exist, no need to remove"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
echo "Uninstalling AllPac..."
|
||
|
|
||
|
# Remove ~/.allpac directory
|
||
|
remove_if_exists "$HOME/.allpac"
|
||
|
|
||
|
# Remove /etc/profile.d/allpac.sh
|
||
|
sudo remove_if_exists "/etc/profile.d/allpac.sh"
|
||
|
|
||
|
echo "AllPac has been uninstalled."
|