glacier-old/glacier-install.sh

34 lines
952 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
2022-03-28 17:03:37 -04:00
echo "[ i ] Installing $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
2022-04-05 11:02:18 -04:00
chmod +x $input.ts.sh
2022-03-09 17:01:26 -05:00
./INSTALL.sh # Actually executes installation script
2022-04-05 11:02:18 -04:00
./$input.ts.sh
2022-03-09 17:01:26 -05:00
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."