From e55679d37948b26e1e7466440312de5acadc433a Mon Sep 17 00:00:00 2001 From: everest-linux Date: Tue, 12 Apr 2022 16:38:01 +0000 Subject: [PATCH] 0.7rc --- README.md | 2 + glacier.conf | 11 +++++ install/INSTALL-GLACIER.sh | 40 +++++++++++++++++ install/UNINSTALL-GLACIER.sh | 20 +++++++++ install/UPDATE-GLACIER.sh | 34 ++++++++++++++ install/WGET-INSTALL.sh | 7 +++ scripts/glacier-cache-clear.sh | 13 ++++++ scripts/glacier-cache-install.sh | 33 ++++++++++++++ scripts/glacier-cache.sh | 61 +++++++++++++++++++++++++ scripts/glacier-help.sh | 18 ++++++++ scripts/glacier-install.sh | 61 +++++++++++++++++++++++++ scripts/glacier-query.sh | 11 +++++ scripts/glacier-remove.sh | 74 +++++++++++++++++++++++++++++++ scripts/glacier-update.sh | 76 ++++++++++++++++++++++++++++++++ 14 files changed, 461 insertions(+) create mode 100644 glacier.conf create mode 100644 install/INSTALL-GLACIER.sh create mode 100644 install/UNINSTALL-GLACIER.sh create mode 100644 install/UPDATE-GLACIER.sh create mode 100644 install/WGET-INSTALL.sh create mode 100644 scripts/glacier-cache-clear.sh create mode 100644 scripts/glacier-cache-install.sh create mode 100644 scripts/glacier-cache.sh create mode 100644 scripts/glacier-help.sh create mode 100644 scripts/glacier-install.sh create mode 100644 scripts/glacier-query.sh create mode 100644 scripts/glacier-remove.sh create mode 100644 scripts/glacier-update.sh diff --git a/README.md b/README.md index 0848600..f03f31a 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ Glacier is intended to be a universal package manager, and should work on all di Packages should be submitted by sending a pull request. A maintainer will test the package to make sure it downloads correctly. # Latest News + + 4/12/22 > Added support for multiple repositories (world, galaxy, universe, multiverse, and their testing counterparts). 4/5/22 > Added package timestamps. New package uploads will be halted until all current packages have timestamp capabilities added. To do this, add a script called (package_name).ts.sh, which should contain 2 commands: ``` diff --git a/glacier.conf b/glacier.conf new file mode 100644 index 0000000..8d246b3 --- /dev/null +++ b/glacier.conf @@ -0,0 +1,11 @@ +# Glacier configuration file + +# Repositories Glacier will use +GREPO1=world +GREPO2=galaxy +GREPO3=universe +#GREPO4=multiverse +#GREPO5=world-testing +#GREPO6=galaxy-testing +#GREPO7=universe-testing +#GREPO8=multiverse-testing diff --git a/install/INSTALL-GLACIER.sh b/install/INSTALL-GLACIER.sh new file mode 100644 index 0000000..dcc0e8c --- /dev/null +++ b/install/INSTALL-GLACIER.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# Glacier Installation Script + +# Require the script to be run as root +if [[ $(/usr/bin/id -u) -ne 0 ]]; then + echo "[ X ] Please run Glacier installation script as root." + exit +fi + +mkdir /etc/glacier && echo "[ i ] Creating Glacier directory..." +mkdir /etc/glacier/pkginfo && echo "[ i ] Creating Glacier package list directory..." +mkdir /var/cache/glacier && echo "[ i ] Creating Glacier package cache..." +mkdir /var/log/glacier && echo "[ i ] Creating Glacier timestamp log..." +chmod +x ../glacier-install.sh +chmod +x ../glacier-remove.sh +chmod +x ../glacier-update.sh +chmod +x ../glacier-query.sh +chmod +x ../glacier-cache.sh +chmod +x ../glacier-cache-install.sh +chmod +x ../glacier-cache-clear.sh +chmod +x ../glacier-help.sh +echo "[ i ] Installing glacier..." +cd ../scripts +cp glacier-install.sh glacier-install +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." diff --git a/install/UNINSTALL-GLACIER.sh b/install/UNINSTALL-GLACIER.sh new file mode 100644 index 0000000..4dddf90 --- /dev/null +++ b/install/UNINSTALL-GLACIER.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# Require the script to be run as root +if [[ $(/usr/bin/id -u) -ne 0 ]]; then + echo "[ X ] Please run Glacier uninstallation as root." + exit +fi + +echo "[ ! ] It is recommended to uninstall all Glacier packages before uninstalling Glacier." +echo "[ ! ] This will prevent untracked packages from remaining on your system and possibly creating a security risk." +echo "[ ! ] To see which packages are installed on your system, run the following command:" +echo "[ ! ] ls /etc/glacier/pkginfo" +while true; do + read -p "[ ? ] Would you like to uninstall Glacier?" yn + 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;; + [Nn]* ) exit;; + * ) echo "[ ! ] You must answer either yes or no.";; + esac +done diff --git a/install/UPDATE-GLACIER.sh b/install/UPDATE-GLACIER.sh new file mode 100644 index 0000000..29d280e --- /dev/null +++ b/install/UPDATE-GLACIER.sh @@ -0,0 +1,34 @@ +#!/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." diff --git a/install/WGET-INSTALL.sh b/install/WGET-INSTALL.sh new file mode 100644 index 0000000..0783be4 --- /dev/null +++ b/install/WGET-INSTALL.sh @@ -0,0 +1,7 @@ +#!/bin.sh + +mkdir ../glacier-tmp +wget https://github.com/everest-linux/glacier/blob/main/glacier-install.sh +wget https://github.com/everest-linux/glacier/blob/main/glacier-update.sh +wget https://github.com/everest-linux/glacier/blob/main/glacier-remove.sh +wget https://github.com/everest-linux/glacier/blob/main/glacier-query.sh diff --git a/scripts/glacier-cache-clear.sh b/scripts/glacier-cache-clear.sh new file mode 100644 index 0000000..c03ac57 --- /dev/null +++ b/scripts/glacier-cache-clear.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# glacier-cache-clear +# Script used to clear Glacier's cache + +# 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 "[ i ] Clearing cache..." +cd /var/cache/glacier && rm *.tar.gz +echo "[ i ] Cache was cleared." diff --git a/scripts/glacier-cache-install.sh b/scripts/glacier-cache-install.sh new file mode 100644 index 0000000..1a0d3aa --- /dev/null +++ b/scripts/glacier-cache-install.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# glacier-cache-install +# Script used to install cached packages + +# 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 ] Checking cache for $input.tar.gz" +cd /var/cache/glacier && cp $input.tar.gz /tmp && cd /tmp +if [ "$?" != "0" ]; then + echo "[ X ] Could not fetch $input.tar.gz from cache." 1>&2 + exit 1 +fi +echo "[ i ] Unpacking $input.tar.gz..." +mkdir -v $input && mv -v $input.tar.gz $input && cd $input +tar -xvf $input.tar.gz +if [ "$?" != "0" ]; then + echo "[ X ] 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 +echo "[ i ] Cleaning up..." # Status message +mv -v $input-pkginfo.json /etc/glacier/pkginfo +cd .. +rm -rvf $input +echo "[ i ] Operation completed." diff --git a/scripts/glacier-cache.sh b/scripts/glacier-cache.sh new file mode 100644 index 0000000..ee0af05 --- /dev/null +++ b/scripts/glacier-cache.sh @@ -0,0 +1,61 @@ +#!/bin/sh +# glacier-cache +# Script used to download a package and cache it + +# Require the script to be run as root +echo "[ ? ] Enter package name:" && read input +echo "[ i ] Installing $input.tar.gz" +echo "Checking world..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO1/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in world." 1>&2 +fi +echo "Checking galaxy..." && wget https://gitub.com/everest-linux/glacier-pkgs/raw/main/$GREPO2/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in galaxy." 1>&2 +fi +echo "Checking universe..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO3/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in universe." 1>&2 +fi +echo "Checking multiverse..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO4/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in multiverse." 1>&2 +fi +echo "Checking world-testing..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO5/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in world-testing." 1>&2 +fi +echo "Checking galaxy-testing..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO6/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in galaxy-testing." 1>&2 +fi +echo "Checking universe-testing..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO7/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in universe-testing." 1>&2 +fi +echo "Checking multiverse-testing.." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO8/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in multiverse-testing." 1>&2 +fi + +echo "[ i ] Unpacking $input.tar.gz..." +mkdir -v $input && mv -v $input.tar.gz $input && cd $input +tar -xvf $input.tar.gz +if [ "$?" != "0" ]; then + echo "[ X ] Could not unpack $input.tar.gz" 1>&2 + exit 1 +fi +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." diff --git a/scripts/glacier-help.sh b/scripts/glacier-help.sh new file mode 100644 index 0000000..ec44d2a --- /dev/null +++ b/scripts/glacier-help.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +echo "Glacier Package Manager v0.5rc" +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 is unlike a traditional package manager where you apend a package name to the command. Instead, Glacier will ask you which package you wish to install." +echo "" +echo "Copyright (c) 2022 Everest Linux Developers" +echo "This software includes no warranty whatsoever. See the GNU GPL v3.0 for more information." diff --git a/scripts/glacier-install.sh b/scripts/glacier-install.sh new file mode 100644 index 0000000..34e5ba2 --- /dev/null +++ b/scripts/glacier-install.sh @@ -0,0 +1,61 @@ +#!/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 ] Installing $input.tar.gz" +echo "Checking world..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO1/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in world." 1>&2 +fi +echo "Checking galaxy..." && wget https://gitub.com/everest-linux/glacier-pkgs/raw/main/$GREPO2/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in galaxy." 1>&2 +fi +echo "Checking universe..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO3/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in universe." 1>&2 +fi +echo "Checking multiverse..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO4/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in multiverse." 1>&2 +fi +echo "Checking world-testing..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO5/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in world-testing." 1>&2 +fi +echo "Checking galaxy-testing..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO6/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in galaxy-testing." 1>&2 +fi +echo "Checking universe-testing..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO7/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in universe-testing." 1>&2 +fi +echo "Checking multiverse-testing.." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO8/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in multiverse-testing." 1>&2 +fi + +echo "[ i ] Unpacking $input.tar.gz..." +mkdir -v $input && mv -v $input.tar.gz $input && cd $input +tar -xvf $input.tar.gz +if [ "$?" != "0" ]; then + echo "[ X ] 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 +echo "[ i ] Cleaning up..." # Status message +mv -v $input-pkginfo.json /etc/glacier/pkginfo +cd .. +rm -rvf $input +echo "[ i ] Operation completed." diff --git a/scripts/glacier-query.sh b/scripts/glacier-query.sh new file mode 100644 index 0000000..a3c3ead --- /dev/null +++ b/scripts/glacier-query.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# glacier-query +# Script used to query packages on the system + +echo "[ ? ] Enter package name:" && read input +cat /etc/glacier/pkginfo/$input-pkginfo.json +cat /var/log/glacier/$input.timestamp +if [ "$?" != "0" ]; then + echo "[ X ] Package $input not found!" 1>&2 + exit 1 +fi diff --git a/scripts/glacier-remove.sh b/scripts/glacier-remove.sh new file mode 100644 index 0000000..2f24880 --- /dev/null +++ b/scripts/glacier-remove.sh @@ -0,0 +1,74 @@ +#!/bin/sh +# glacier-remove +# Script used to uninstall packages + +# 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 ] Installing $input.tar.gz" +echo "Checking world..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO1/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in world." 1>&2 +fi +echo "Checking galaxy..." && wget https://gitub.com/everest-linux/glacier-pkgs/raw/main/$GREPO2/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in galaxy." 1>&2 +fi +echo "Checking universe..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO3/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in universe." 1>&2 +fi +echo "Checking multiverse..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO4/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in multiverse." 1>&2 +fi +echo "Checking world-testing..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO5/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in world-testing." 1>&2 +fi +echo "Checking galaxy-testing..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO6/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in galaxy-testing." 1>&2 +fi +echo "Checking universe-testing..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO7/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in universe-testing." 1>&2 +fi +echo "Checking multiverse-testing.." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO8/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in multiverse-testing." 1>&2 +fi + +echo "[ i ] Unpacking $input.tar.gz..." +mkdir -v $input && mv -v $input.tar.gz $input && cd $input +tar -xvf $input.tar.gz +if [ "$?" != "0" ]; then + echo "[ X ] Could not unpack $input.tar.gz" 1>&2 + exit 1 +fi +echo "[ ? ] Enter package name:" && read input +echo "[ i ] Preparing to remove $input..." +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 +echo "[ i ] Fetching removal instructions..." +mkdir -v $input && mv -v $input.tar.gz $input && cd $input +tar -xvf $input.tar.gz +if [ "$?" != "0" ]; then + echo "[ X ] Could not unpack $input.tar.gz" 1>&2 + exit 1 +fi +chmod +x REMOVE.sh +./REMOVE.sh +rm /var/log/glacier/$input.timestamp +echo "[ i ] Cleaning up..." +cd .. +rm -rvf $input +rm /etc/glacier/pkginfo/$input-pkginfo.json +echo "[ i ] Operation completed." diff --git a/scripts/glacier-update.sh b/scripts/glacier-update.sh new file mode 100644 index 0000000..54edd89 --- /dev/null +++ b/scripts/glacier-update.sh @@ -0,0 +1,76 @@ +#!/bin/sh +# glacier-update +# Script used to update packages + +# Script messes shit up if you don't run as root so thats why this is here +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 ] Updating $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 +fiecho "[ ? ] Enter package name:" && read input +echo "[ i ] Installing $input.tar.gz" +echo "Checking world..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO1/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in world." 1>&2 +fi +echo "Checking galaxy..." && wget https://gitub.com/everest-linux/glacier-pkgs/raw/main/$GREPO2/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in galaxy." 1>&2 +fi +echo "Checking universe..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO3/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in universe." 1>&2 +fi +echo "Checking multiverse..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO4/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in multiverse." 1>&2 +fi +echo "Checking world-testing..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO5/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in world-testing." 1>&2 +fi +echo "Checking galaxy-testing..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO6/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in galaxy-testing." 1>&2 +fi +echo "Checking universe-testing..." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO7/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in universe-testing." 1>&2 +fi +echo "Checking multiverse-testing.." && wget https://github.com/everest-linux/glacier-pkgs/raw/main/$GREPO8/$input.tar.gz +if [ "$?" != "0" ]; then + echo "[ i ] Not in multiverse-testing." 1>&2 +fi +echo "[ i ] Unpacking $input.tar.gz..." +mkdir -v $input && mv -v $input.tar.gz $input && cd $input +tar -xvf $input.tar.gz +if [ "$?" != "0" ]; then + echo "[ X ] Could not unpack $input.tar.gz" 1>&2 + exit 1 +fi + +rm /var/log/glacier/$input.timestamp +echo "[ i ] Unpacking $input,tar.gz..." +mkdir -v $input && mv -v $input.tar.gz $input && cd $input +tar -xvf $input.tar.gz +if [ "$?" != "0" ]; then + echo "[ X ] Could not unpack $input.tar.gz" 1>&2 + exit 1 +fi +chmod +x UPDATE.sh +chmod +x $input.ts.sh +./UPDATE.sh +./$input.ts.sh +echo "[ i ] Cleaning up..." +mv -v $input-pkginfo.json /etc/glacier/pkginfo +mv $input.timestamp /var/log/glacier +cd .. +rm -rvf $input +echo "[ i ] Operation completed."