From efada985df5b80cf86e9ba7ceb846f2bcd852b0b Mon Sep 17 00:00:00 2001 From: everest Date: Thu, 16 Jun 2022 14:51:15 +0000 Subject: [PATCH] Update glacier --- scripts/glacier | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/glacier b/scripts/glacier index 01274e4..db37274 100644 --- a/scripts/glacier +++ b/scripts/glacier @@ -60,6 +60,10 @@ while [[ $# -gt 0 ]]; do cat INSTALL.sh printf "\033[1;34m [ i ] \033[m Executing installation instructions...\n" ./INSTALL.sh + if [ "$?" != "0" ]; then + printf "$red [ $error ]$reset Instructions were either unable to execute, or encountered an error while executing." 1>&2 + exit 1 + fi ./$input.ts.sh # Clean up printf "\033[1;34m [ i ] \033[m Cleaning up...\n" @@ -99,6 +103,10 @@ while [[ $# -gt 0 ]]; do cat UPDATE.sh printf "\033[1;34m [ i ] \033[m Executing update instructions...\n" ./UPDATE.sh + if [ "$?" != "0" ]; then + printf "$red [ $error ]$reset Instructions were either unable to execute, or encountered an error while executing." 1>&2 + exit 1 + fi ./$input.ts.sh printf "\033[1;34m [ i ] \033[m Cleaning up...\n" mv $input-pkginfo.json /etc/glacier/pkginfo @@ -135,6 +143,10 @@ while [[ $# -gt 0 ]]; do cat REMOVE.sh printf "$blue [ i ] $reset Executing removal instructions...\n" ./REMOVE.sh + if [ "$?" != "0" ]; then + printf "$red [ $error ]$reset Instructions were either unable to execute, or encountered an error while executing." 1>&2 + exit 1 + fi rm /var/log/glacier/$input.timestamp printf "\033[1;34m [ i ] \033[m Cleaning up... \n" # Status message cd .. @@ -197,6 +209,10 @@ while [[ $# -gt 0 ]]; do chmod +x INSTALL.sh chmod +x $input.ts.sh ./INSTALL.sh # Actually executes installation script + if [ "$?" != "0" ]; then + printf "$red [ $error ]$reset Instructions were either unable to execute, or encountered an error while executing." 1>&2 + exit 1 + fi ./$input.ts.sh printf "\033[1;34m [ i ] \033[m Cleaning up...\n" # Status message mv -v $input-pkginfo.json /etc/glacier/pkginfo