Compare commits

...

9 Commits

Author SHA1 Message Date
everest
b4e28b39a8
Add files via upload 2022-05-31 13:06:14 +00:00
everest
56eee46ca6
Delete glacier.conf 2022-05-31 13:05:37 +00:00
everest
6ee344e556
Delete README.md 2022-05-31 13:05:29 +00:00
everest
7f74261a2d
Delete LICENSE 2022-05-31 13:05:22 +00:00
everest
08f0b393a2
Delete scripts directory 2022-05-31 13:05:14 +00:00
everest
bbc1452841
Delete WGET-INSTALL.sh 2022-05-31 13:04:59 +00:00
everest
3db46f6ba0
Delete UPDATE-GLACIER.sh 2022-05-31 13:04:53 +00:00
everest
ce8d3944d9
Delete UNINSTALL-GLACIER.sh 2022-05-31 13:02:36 +00:00
everest
6358608828
Delete INSTALL-GLACIER.sh 2022-05-31 13:02:30 +00:00
16 changed files with 219 additions and 313 deletions

View File

@ -20,6 +20,8 @@ Packages should be submitted by sending a pull request to https://github.com/eve
# Latest News # Latest News
5/27/22 > Happy Memorial Day to everyone in the US. I've added a new file, `/etc/glacier/hooks.sh` that will define startup hooks when any Glacier script is run. It is highly recommended to keep both default hooks, and to create `/etc/make.conf`. 1.3
5/17/22 > Considering adding command line parsing 5/17/22 > Considering adding command line parsing
5/3/22 > Multi repository support is back! 1.2 5/3/22 > Multi repository support is back! 1.2

View File

@ -7,35 +7,14 @@ if [[ $(/usr/bin/id -u) -ne 0 ]]; then
exit exit
fi fi
mv ../glacier.conf /etc mv ../scripts/glacier.conf /etc
mkdir /etc/glacier && echo "[ i ] Creating Glacier directory..." mkdir /etc/glacier && echo "[ i ] Creating Glacier directory..."
mkdir /etc/glacier/pkginfo && echo "[ i ] Creating Glacier package list directory..." mkdir /etc/glacier/pkginfo && echo "[ i ] Creating Glacier package list directory..."
mkdir /var/cache/glacier && echo "[ i ] Creating Glacier package cache..." mkdir /var/cache/glacier && echo "[ i ] Creating Glacier package cache..."
mkdir /var/log/glacier && echo "[ i ] Creating Glacier timestamp log..." mkdir /var/log/glacier && echo "[ i ] Creating Glacier timestamp log..."
chmod +x ../scripts/glacier-install.sh mv ../scripts/hooks.sh /etc/glacier
chmod +x ../scripts/glacier-remove.sh chmod +x ../scripts/glacier
chmod +x ../scripts/glacier-update.sh
chmod +x ../scripts/glacier-query.sh
chmod +x ../scripts/glacier-cache.sh
chmod +x ../scripts/glacier-cache-install.sh
chmod +x ../scripts/glacier-cache-clear.sh
chmod +x ../scripts/glacier-help.sh
echo "[ i ] Installing glacier..." echo "[ i ] Installing glacier..."
cd ../scripts cd ../scripts
cp glacier-install.sh glacier-install mv glacier /bin
cp glacier-remove.sh glacier-remove
cp glacier-update.sh glacier-update
cp glacier-query.sh glacier-query
cp glacier-cache.sh glacier-cache
cp glacier-cache-install.sh glacier-cache-install
cp glacier-cache-clear.sh glacier-cache-clear
cp glacier-help.sh glacier-help
mv glacier-install /bin
mv glacier-remove /bin
mv glacier-update /bin
mv glacier-query /bin
mv glacier-cache /bin
mv glacier-cache-install /bin
mv glacier-cache-clear /bin
mv glacier-help /bin
echo "[ i ] Glacier has finished installing successfully." echo "[ i ] Glacier has finished installing successfully."

View File

@ -13,7 +13,7 @@ echo "[ ! ] ls /etc/glacier/pkginfo"
while true; do while true; do
read -p "[ ? ] Would you like to uninstall Glacier?" yn read -p "[ ? ] Would you like to uninstall Glacier?" yn
case $yn in case $yn in
[Yy]* ) rm -rf /etc/glacier && rm -rf /var/cache/glacier && rm -rf /var/log/glacier && rm /bin/glacier-install && rm /bin/glacier-update && rm /bin/glacier-remove && rm /bin/glacier-query && rm /bin/glacier-help; break;; [Yy]* ) rm -rf /etc/glacier && rm -rf /var/cache/glacier && rm -rf /var/log/glacier && rm /bin/glacier; break;;
[Nn]* ) exit;; [Nn]* ) exit;;
* ) echo "[ ! ] You must answer either yes or no.";; * ) echo "[ ! ] You must answer either yes or no.";;
esac esac

View File

@ -1,34 +0,0 @@
#!/bin/sh
# Require the script to be run as root
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "[ X ] Please run Glacier update script as root."
exit
fi
echo "[ i ] Removing outdated binaries..."
rm /bin/glacier-install
rm /bin/glacier-update
rm /bin/glacier-remove
rm /bin/glacier-query
rm /bin/glacier-help
echo "[ i ] Marking new binaries as executable..."
cd ../scripts
chmod +x glacier-install.sh
chmod +x glacier-update.sh
chmod +x glacier-remove.sh
chmod +x glacier-query.sh
chmod +x glacier-help.sh
echo "[ i ] Preparing to install new binaries..."
cp glacier-install.sh glacier-install
cp glacier-update.sh glacier-update
cp glacier-remove.sh glacier-remove
cp glacier-query.sh glacier-query
cp glacier-help.sh glacier-help
echo "[ i ] Installing new binaries..."
mv glacier-install /bin
mv glacier-update /bin
mv glacier-remove /bin
mv glacier-query /bin
mv glacier-help /bin
echo "[ i ] Glacier was successfully updated to the latest version."

View File

@ -1,3 +0,0 @@
#!/bin.sh
rm -rf /tmp/glacier && cd /tmp && git clone https://github.com/everest-linux/glacier && cd glacier/install && chmod +x INSTALL-GLACIER.sh && sudo ./INSTALL-GLACIER.sh

206
scripts/glacier Normal file
View File

@ -0,0 +1,206 @@
#!/bin/sh
# Glacier - A source based package manager written in POSIX sh
# (C) 2022 Everest Developers
# This program is free software: see the GNU GPL v3.0 for details.
# Preloading
source /etc/glacier/hooks.sh
while [[ $# -gt 0 ]]; do
case $1 in
-h|--help)
printf "$blue Glacier - A source based package manager written in POSIX sh $reset\n"
printf "glacier {-h --help} show this message and exit\n"
printf "glacier {--version} display the current Glacier version and exit\n"
printf "glacier {install -f} install a package\n"
printf "glacier {update -u} update a package\n"
printf "glacier {remove -x} remove a package\n"
printf "glacier {query -q} query a package\n"
printf "glacier {cache -c} cache a package\n"
printf "glacier {cache-install -ci} install a cached package\n"
printf "glacier {cache-clear -cc} clear the package cache\n"
printf "\n"
printf "This program is free software: see the GNU GPL v3.0 for details.\n"
exit 0
;;
--version)
printf "$blue Glacier v2.0 $reset\n"
exit 0
;;
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."
exit
fi
printf "\033[1;34m [ ? ] \033[m Enter package name: " && read input
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
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 [ \xE2\x9C\x95 ] \033[m Could not unpack $input.tar.gz. " 1>&2
exit 1
fi
chmod +x INSTALL.sh
chmod +x $input.ts.sh
printf "\033[1;34m [ i ] \033[m Executing installation instructions...\n"
./INSTALL.sh # Actually executes installation script
./$input.ts.sh
printf "\033[1;34m [ i ] \033[m Cleaning up...\n" # Status message
mv $input-pkginfo.json /etc/glacier/pkginfo
cd ..
rm -rf $input
printf "\033[1;32m [ \xE2\x9C\x93 ] \033[m Operation completed.\n"
exit 0
;;
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."
exit
fi
printf "\033[1;34m [ ? ] \033[m Enter package name: " && read input
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
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
exit 1
fi
rm /var/log/glacier/$input.timestamp
chmod +x UPDATE.sh
chmod +x $input.ts.sh
./UPDATE.sh
./$input.ts.sh
printf "\033[1;34m [ i ] \033[m Cleaning up...\n"
mv $input-pkginfo.json /etc/glacier/pkginfo
mv $input.timestamp /var/log/glacier
cd ..
rm -rf $input
printf "\033[1;32m [ $check ] \033[m Operation completed.\n"
exit 0
;;
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."
exit
fi
printf "\033[1;34m [ ? ] \033[m Enter package name: " && read input
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
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
exit 1
fi
chmod +x REMOVE.sh
./REMOVE.sh
rm /var/log/glacier/$input.timestamp
printf "\033[1;34m [ i ] \033[m Cleaning up... \n" # Status message
cd ..
rm -rf $input
rm /etc/glacier/pkginfo/$input-pkginfo.json
printf "\033[1;32m [ $check ] \033[m Operation completed.\n"
exit 0
;;
query|-q)
printf "\033[1;34m [ ? ] \033[m Enter package name: " && read input
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
exit 1
fi
exit 0
;;
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."
exit
fi
printf "\033[1;34m [ ? ] \033[m Enter package name: " && read input
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
exit 1
fi
mv $input.tar.gz /var/cache/glacier
printf "\033[1;32m [ $check ] \033[m Operation completed."
exit 0
;;
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."
exit
fi
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
printf "\033[1;31m [ $error ] \033[m Could not fetch package from cache. " 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
exit 1
fi
chmod +x INSTALL.sh
chmod +x $input.ts.sh
./INSTALL.sh # Actually executes installation script
./$input.ts.sh
printf "\033[1;34m [ i ] \033[m Cleaning up... " # Status message
mv -v $input-pkginfo.json /etc/glacier/pkginfo
cd ..
rm -rvf $input
printf "\033[1;32m [ $check ] \033[m Operation completed."
exit 0
;;
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."
exit
fi
printf "\033[1;34m [ i ] \033[m Clearing cache... "
cd /var/cache/glacier && rm *
printf "\033[1;32m [ $check ] \033[m Cache cleared."
exit 0
;;
-*|--*)
printf "$red[ $error ]$reset Unknown option, use 'glacier -h' to see usage. $reset"
exit 1
;;
esac
done

View File

@ -1,17 +0,0 @@
#!/bin/sh
# glacier-cache-clear
# Script used to clear Glacier's cache
# Glacier preloading
source /etc/glacier.conf
# 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."
exit
fi
printf "\033[1;34m [ i ] \033[m Clearing cache... "
cd /var/cache/glacier && rm *
printf "\033[1;32m [ $check ] \033[m Cache cleared."

View File

@ -1,37 +0,0 @@
#!/bin/sh
# glacier-cache-install
# Script used to install cached packages
# Glacier preloading
source /etc/glacier.conf
# 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
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
printf "\033[1;31m [ $error ] \033[m Could not fetch package from cache. " 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
exit 1
fi
chmod +x INSTALL.sh
chmod +x $input.ts.sh
./INSTALL.sh # Actually executes installation script
./$input.ts.sh
printf "\033[1;34m [ i ] \033[m Cleaning up... " # Status message
mv -v $input-pkginfo.json /etc/glacier/pkginfo
cd ..
rm -rvf $input
printf "\033[1;32m [ $check ] \033[m Operation completed."

View File

@ -1,23 +0,0 @@
#!/bin/sh
# glacier-cache
# Script used to download a package and cache it
# Glacier preloading
source /etc/glacier.conf
# 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."
exit
fi
printf "\033[1;34m [ ? ] \033[m Enter package name: " && read input
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
exit 1
fi
mv $input.tar.gz /var/cache/glacier
printf "\033[1;32m [ $check ] \033[m Operation completed."

View File

@ -1,19 +0,0 @@
#!/bin/sh
echo "Glacier Package Manager v1.2"
echo "====================================================================="
echo "An extremely light and fast ackage manager written entirely in shell."
echo ""
echo "glacier-install - Install a package"
echo "glacier-update - Update a package"
echo "glacier-remove - Remove a package"
echo "glacier-query - Query a package"
echo "glacier-cache - Add a package to the cache"
echo "glacier-cache-install - Install a cached package"
echo "glacier-cache-clear - Clear Glacier's cache"
echo ""
echo "IMPORTANT REMINDER - Glacier will ask you which package to install, glacier-install <package> will not work."
echo ""
echo "Glacier - Copyright (C) 2022 Everest Linux"
echo "This program comes with ABSOLUTELY NO WARRANTY; for details see section 15 of the GNU GPL v3."
echo "This is free software, and you are welcome to redistribute it under certain conditions; see the GNU GPL v3 for details."

View File

@ -1,51 +0,0 @@
#!/bin/sh
# glacier-install
# Script used to fetch installation scripts and run them
# Define colors
export red="\033[1;31m"
export green="\033[1;32m"
export yellow="\033[1;33m"
export blue="\033[1;34m"
export reset="\033[m"
# Define unicode symbols
export check="\xE2\x9C\x93"
export error="\xE2\x9C\x95"
export warning="\x21"
export question="\x3F"
# Glacier preloading
source /etc/glacier.conf
# 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."
exit
fi
printf "\033[1;34m [ ? ] \033[m Enter package name: " && read input
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
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 [ \xE2\x9C\x95 ] \033[m Could not unpack $input.tar.gz. " 1>&2
exit 1
fi
chmod +x INSTALL.sh
chmod +x $input.ts.sh
printf "\033[1;34m [ i ] \033[m Executing installation instructions...\n"
./INSTALL.sh # Actually executes installation script
./$input.ts.sh
printf "\033[1;34m [ i ] \033[m Cleaning up...\n" # Status message
mv $input-pkginfo.json /etc/glacier/pkginfo
cd ..
rm -rf $input
printf "\033[1;32m [ \xE2\x9C\x93 ] \033[m Operation completed.\n"

View File

@ -1,15 +0,0 @@
#!/bin/sh
# glacier-query
# Script used to query packages on the system
# Glacier preloading
source /etc/glacier.conf
printf "\033[1;34m [ ? ] \033[m Enter package name: " && read input
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
exit 1
fi

View File

@ -1,49 +0,0 @@
#!/bin/sh
# glacier-remove
# Script used to uninstall packages
# Define colors
export red="\033[1;31m"
export green="\033[1;32m"
export yellow="\033[1;33m"
export blue="\033[1;34m"
export reset="\033[m"
# Define unicode symbols
export check="\xE2\x9C\x93"
export error="\xE2\x9C\x95"
export warning="\x21"
export question="\x3F"
# Glacier preloading
source /etc/glacier.conf
# 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."
exit
fi
printf "\033[1;34m [ ? ] \033[m Enter package name: " && read input
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
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
exit 1
fi
chmod +x REMOVE.sh
./REMOVE.sh
rm /var/log/glacier/$input.timestamp
printf "\033[1;34m [ i ] \033[m Cleaning up... \n" # Status message
cd ..
rm -rf $input
rm /etc/glacier/pkginfo/$input-pkginfo.json
printf "\033[1;32m [ $check ] \033[m Operation completed.\n"

View File

@ -1,39 +0,0 @@
#!/bin/sh
# glacier-update
# Script used to update packages
# Glacier preloading
source /etc/glacier.conf
# 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."
exit
fi
printf "\033[1;34m [ ? ] \033[m Enter package name: " && read input
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
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
exit 1
fi
rm /var/log/glacier/$input.timestamp
chmod +x UPDATE.sh
chmod +x $input.ts.sh
./UPDATE.sh
./$input.ts.sh
printf "\033[1;34m [ i ] \033[m Cleaning up...\n"
mv $input-pkginfo.json /etc/glacier/pkginfo
mv $input.timestamp /var/log/glacier
cd ..
rm -rf $input
printf "\033[1;32m [ $check ] \033[m Operation completed.\n"

6
scripts/hooks.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# /etc/glacier/hooks.sh
# Hooks that will be run while calling Glacier
source /etc/glacier.conf
source /etc/make.conf