2022-03-09 17:01:26 -05:00
|
|
|
#!/bin/sh
|
|
|
|
# glacier-remove
|
|
|
|
# Script used to uninstall packages
|
|
|
|
|
|
|
|
# Require the script to be run as root
|
|
|
|
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
|
|
|
echo "[ X ] Please run Glacier as root."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "[ ? ] Enter package name:" && read input
|
|
|
|
echo "[ i ] Preparing to remove $input..."
|
2022-03-10 12:27:51 -05:00
|
|
|
wget https://github.com/everest-linux/glacier-pkgs/raw/main/pkgs/$input.tar.gz
|
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
echo "[ X ] Could not get archive for $input." 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-03-09 17:01:26 -05:00
|
|
|
echo "[ i ] Fetching removal instructions..."
|
2022-03-28 11:22:02 -04:00
|
|
|
mkdir -v $input && mv -v $inpit.tar.gz $input && cd $input
|
2022-03-10 12:27:51 -05:00
|
|
|
tar -xvf $input.tar.gz
|
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
echo "[ X ] Could not unpack $input.tar.gz" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-03-09 17:01:26 -05:00
|
|
|
chmod +x REMOVE.sh
|
|
|
|
./REMOVE.sh
|
|
|
|
echo "[ i ] Cleaning up..."
|
2022-03-28 11:22:02 -04:00
|
|
|
cd ..
|
|
|
|
rm -rvf $input
|
2022-03-09 17:01:26 -05:00
|
|
|
rm /etc/glacier/pkginfo/$input-pkginfo.json
|
2022-03-10 12:27:51 -05:00
|
|
|
echo "[ i ] Operation completed."
|