Update glacier

This commit is contained in:
everest 2022-06-07 14:43:25 +00:00 committed by GitHub
parent 34327f5d08
commit e7ae67d256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,7 @@ while [[ $# -gt 0 ]]; do
install|-f)
# Require the script to be run as root
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
printf "\033[1;31m [ \xE2\x9C\x95 ] \033[m Please run Glacier as root."
printf "\033[1;31m [ \xE2\x9C\x95 ] \033[m Please run Glacier as root.\n"
exit
fi
@ -40,7 +40,7 @@ while [[ $# -gt 0 ]]; do
printf "\033[1;34m [ i ] \033[m Installing $input.tar.gz...\n"
printf "\033[1;34m [ i ] \033[m Checking databases... " && wget $GREPO1/$input.tar.gz -q --show-progress || wget $GREPO2/$input.tar.gz -q --show-progress || wget $GREPO3/$input.tar.gz -q --show-progress || wget $GREPO4/$input.tar.gz -q --show-progress || wget $GREPO5/$input.tar.gz -q --show-progress || wget $GREPO6/$input.tar.gz -q --show-progress || wget $GREPO7/$input.tar.gz -q --show-progress || wget $GREPO8/$input.tar.gz -q --show-progress
if [ "$?" != "0" ]; then
printf "\033[1;31m [ \xE2\x9C\x95 ] \033[m Package not found. " 1>&2
printf "\033[1;31m [ \xE2\x9C\x95 ] \033[m Package not found.\n" 1>&2
exit 1
fi
# Unpack Tarball
@ -48,7 +48,7 @@ while [[ $# -gt 0 ]]; do
mkdir $input && mv $input.tar.gz $input && cd $input
tar -xf $input.tar.gz
if [ "$?" != "0" ]; then
printf "\033[1;31m [ \xE2\x9C\x95 ] \033[m Could not unpack $input.tar.gz. " 1>&2
printf "\033[1;31m [ \xE2\x9C\x95 ] \033[m Could not unpack $input.tar.gz.\n" 1>&2
exit 1
fi
# Run installation hooks
@ -70,7 +70,7 @@ while [[ $# -gt 0 ]]; do
update|-u)
# Require Glacier to be run as root
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
printf "\033[1;31m [ $error ] \033[m Please run Glacier as root."
printf "\033[1;31m [ $error ] \033[m Please run Glacier as root.\n"
exit
fi
@ -78,14 +78,14 @@ while [[ $# -gt 0 ]]; do
printf "\033[1;34m [ i ] \033[m Installing $input.tar.gz...\n"
printf "\033[1;34m [ i ] \033[m Checking databases... " && wget $GREPO1/$input.tar.gz -q --show-progress || wget $GREPO2/$input.tar.gz -q --show-progress || wget $GREPO3/$input.tar.gz -q --show-progress || wget $GREPO4/$input.tar.gz -q --show-progress || wget $GREPO5/$input.tar.gz -q --show-progress || wget $GREPO6/$input.tar.gz -q --show-progress || wget $GREPO7/$input.tar.gz -q --show-progress || wget $GREPO8/$input.tar.gz -q --show-progress
if [ "$?" != "0" ]; then
printf "\033[1;31m [ $error ] \033[m Package not found. " 1>&2
printf "\033[1;31m [ $error ] \033[m Package not found.\n" 1>&2
exit 1
fi
printf "\033[1;34m [ i ] \033[m Unpacking $input.tar.gz...\n"
mkdir $input && mv $input.tar.gz $input && cd $input
tar -xf $input.tar.gz
if [ "$?" != "0" ]; then
printf "\033[1;31m [ $error ] \033[m Could not unpack $input.tar.gz. " 1>&2
printf "\033[1;31m [ $error ] \033[m Could not unpack $input.tar.gz.\n" 1>&2
exit 1
fi
rm /var/log/glacier/$input.timestamp
@ -107,7 +107,7 @@ while [[ $# -gt 0 ]]; do
remove|-x)
# Require the script to be run as root
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
printf "\033[1;31m [ $error ] \033[m Please run Glacier as root."
printf "\033[1;31m [ $error ] \033[m Please run Glacier as root.\n"
exit
fi
@ -115,14 +115,14 @@ while [[ $# -gt 0 ]]; do
printf "\033[1;34m [ i ] \033[m Removing $input.tar.gz...\n"
printf "\033[1;34m [ i ] \033[m Checking databases... " && wget $GREPO1/$input.tar.gz -q --show-progress || wget $GREPO2/$input.tar.gz -q --show-progress || wget $GREPO3/$input.tar.gz -q --show-progress || wget $GREPO4/$input.tar.gz -q --show-progress || wget $GREPO5/$input.tar.gz -q --show-progress || wget $GREPO6/$input.tar.gz -q --show-progress || wget $GREPO7/$input.tar.gz -q --show-progress || wget $GREPO8/$input.tar.gz -q --show-progress
if [ "$?" != "0" ]; then
printf "\033[1;31m [ $error ] \033[m Package not found. " 1>&2
printf "\033[1;31m [ $error ] \033[m Package not found.\n" 1>&2
exit 1
fi
printf "\033[1;34m [ i ] \033[m Unpacking $input.tar.gz...\n"
mkdir $input && mv $input.tar.gz $input && cd $input
tar -xf $input.tar.gz
if [ "$?" != "0" ]; then
printf "\033[1;31m [ $error ] \033[m Could not unpack $input.tar.gz. " 1>&2
printf "\033[1;31m [ $error ] \033[m Could not unpack $input.tar.gz.\n" 1>&2
exit 1
fi
chmod +x REMOVE.sh
@ -143,7 +143,7 @@ while [[ $# -gt 0 ]]; do
cat /etc/glacier/pkginfo/$input-pkginfo.json
cat /var/log/glacier/$input.timestamp
if [ "$?" != "0" ]; then
printf "\033[1;31m [ $error ] \033[m Package not found. " 1>&2
printf "\033[1;31m [ $error ] \033[m Package not found.\n" 1>&2
exit 1
fi
exit 0
@ -151,7 +151,7 @@ while [[ $# -gt 0 ]]; do
cache|-c)
# Require the script to be run as root
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
printf "\033[1;31m [ $error ] \033[m Please run Glacier as root."
printf "\033[1;31m [ $error ] \033[m Please run Glacier as root.\n"
exit
fi
@ -159,7 +159,7 @@ while [[ $# -gt 0 ]]; do
printf "\033[1;34m [ i ] \033[m Caching $input.tar.gz...\n"
printf "\033[1;34m [ i ] \033[m Checking databases... " && wget $GREPO1/$input.tar.gz -q --show-progress || wget $GREPO2/$input.tar.gz -q --show-progress || wget $GREPO3/$input.tar.gz -q --show-progress || wget $GREPO4/$input.tar.gz -q --show-progress || wget $GREPO5/$input.tar.gz -q --show-progress || wget $GREPO6/$input.tar.gz -q --show-progress || wget $GREPO7/$input.tar.gz -q --show-progress || wget $GREPO8/$input.tar.gz -q --show-progress
if [ "$?" != "0" ]; then
printf "\033[1;31m [ $error ] \033[m Package not found. " 1>&2
printf "\033[1;31m [ $error ] \033[m Package not found.\n" 1>&2
exit 1
fi
mv $input.tar.gz /var/cache/glacier
@ -169,7 +169,7 @@ while [[ $# -gt 0 ]]; do
cache-install|-ci)
# Require the script to be run as root
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "$red[ $error ]$reset Please run Glacier as root."
echo "$red[ $error ]$reset Please run Glacier as root.\n"
exit
fi
@ -177,14 +177,14 @@ while [[ $# -gt 0 ]]; do
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
printf "\033[1;31m [ $error ] \033[m Could not fetch package from cache. " 1>&2
printf "\033[1;31m [ $error ] \033[m Could not fetch package from cache.\n" 1>&2
exit 1
fi
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
printf "\033[1;31m [ $error ] \033[m Could not unpack $input.tar.gz. " 1>&2
printf "\033[1;31m [ $error ] \033[m Could not unpack $input.tar.gz.\n" 1>&2
exit 1
fi
chmod +x INSTALL.sh
@ -201,12 +201,16 @@ while [[ $# -gt 0 ]]; do
cache-clear|-cc)
# Require the script to be run as root
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
printf "\033[1;31m [ $error ] \033[m Please run Glacier as root."
printf "\033[1;31m [ $error ] \033[m Please run Glacier as root.\n"
exit
fi
printf "\033[1;34m [ i ] \033[m Clearing cache... "
cd /var/cache/glacier && rm *
cd /var/cache/glacier && rm -rf *
if [ "$?" != "0" ]; then
printf "\033[1;31m [ $error ] \033[m Some items could not be cleared.\n" 1>&2
exit 1
fi
printf "\033[1;32m [ $check ] \033[m Cache cleared."
exit 0
;;