Create glacier-cache.sh

This commit is contained in:
everest 2022-03-28 21:03:16 +00:00 committed by GitHub
parent 3643b20cc1
commit 1b7f0699e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

19
glacier-cache.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/sh
# glacier-cache
# Script used to download a package and cache it
# 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 ] Caching $input.tar.gz"
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
mv $input.tar.gz /var/cache/glacier
echo "[ i ] Operation completed.