glacier-old/glacier-update.sh

32 lines
869 B
Bash
Raw Normal View History

2022-03-09 17:01:26 -05:00
#!/bin/sh
# glacier-update
# Script used to update packages
2022-03-28 11:18:37 -04:00
# Script messes shit up if you don't run as root so thats why this is here
2022-03-09 17:01:26 -05:00
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "[ X ] Please run Glacier as root."
exit
fi
echo "[ ? ] Enter package name:" && read input
2022-03-28 17:04:33 -04:00
echo "[ i ] Updating $input.tar.gz..."
2022-03-10 12:29:06 -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 ] Unpacking $input,tar.gz..."
2022-03-28 11:18:37 -04:00
mkdir -v $input && mv -v $input.tar.gz $input && cd $input
2022-03-10 12:29:06 -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 UPDATE.sh
./UPDATE.sh
2022-03-28 11:18:37 -04:00
echo "[ i ] Cleaning up..."
mv -v $input-pkginfo.json /etc/glacier/pkginfo
cd ..
rm -rvf $input
2022-03-10 12:29:06 -05:00
echo "[ i ] Operation completed."