glacier-old/glacier-install.sh

32 lines
916 B
Bash
Raw Normal View History

2022-03-09 17:01:26 -05:00
#!/bin/sh
# glacier-install
# Script used to fetch installation scripts and run them
# 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 ] Downloading $input.tar.gz"
2022-03-10 12:23:12 -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-24 09:47:51 -04:00
mkdir -v $input && mv -v $input.tar.gz $input && cd $input
2022-03-24 09:40:21 -04:00
tar -xvf $input.tar.gz
2022-03-10 12:23:12 -05:00
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 INSTALL.sh
./INSTALL.sh # Actually executes installation script
echo "[ i ] Cleaning up..." # Status message
2022-03-24 09:46:14 -04:00
mv -v $input-pkginfo.json /etc/glacier/pkginfo
2022-03-24 09:37:45 -04:00
cd ..
2022-03-24 09:46:14 -04:00
rm -rvf $input
2022-03-10 12:23:12 -05:00
echo "[ i ] Operation completed."