Update glacier-cache-install.sh

This commit is contained in:
everest 2022-04-20 19:39:04 +00:00 committed by GitHub
parent b1ba7830a7
commit 6b3ee3f6e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,26 +8,26 @@ if [[ $(/usr/bin/id -u) -ne 0 ]]; then
exit
fi
echo "[ ? ] Enter package name:" && read input
echo "[ i ] Checking cache for $input.tar.gz"
printf "\033[1;34m [ ? ] \033[m Enter package name: " && read input
printf "\033[1;34m [ i ] \033[m Checking cache for $input.tar.gz... "
cd /var/cache/glacier && cp $input.tar.gz /tmp && cd /tmp
if [ "$?" != "0" ]; then
echo "[ X ] Could not fetch $input.tar.gz from cache." 1>&2
printf "\033[1;31m [ $error ] \033[m Could not fetch package from cache. " 1>&2
exit 1
fi
echo "[ i ] Unpacking $input.tar.gz..."
mkdir -v $input && mv -v $input.tar.gz $input && cd $input
tar -xvf $input.tar.gz
printf "\033[1;34m [ i ] \033[m Unpacking $input.tar.gz... "
mkdir $input && mv $input.tar.gz $input && cd $input
tar -xf $input.tar.gz
if [ "$?" != "0" ]; then
echo "[ X ] Could not unpack $input.tar.gz" 1>&2
printf "\033[1;31m [ $error ] \033[m Could not unpack $input.tar.gz. " 1>&2
exit 1
fi
chmod +x INSTALL.sh
chmod +x $input.ts.sh
./INSTALL.sh # Actually executes installation script
./$input.ts.sh
echo "[ i ] Cleaning up..." # Status message
printf "\033[1;34m [ i ] \033[m Cleaning up... " # Status message
mv -v $input-pkginfo.json /etc/glacier/pkginfo
cd ..
rm -rvf $input
echo "[ i ] Operation completed."
printf "\033[1;32m [ $check ] \033[m Operation completed."