From 0a4abf75271b3a061f190689af6d0830c40b6ae3 Mon Sep 17 00:00:00 2001 From: kake26 Date: Thu, 30 May 2024 21:09:08 -0500 Subject: [PATCH] Error handling update --- restore.arch.bash | 6 ++++++ restore.deb.bash | 8 ++++++++ restore.wrt.bash | 5 +++++ syssetup.bash | 13 +++++++++++++ 4 files changed, 32 insertions(+) diff --git a/restore.arch.bash b/restore.arch.bash index fb56fa4..c9f4e7a 100755 --- a/restore.arch.bash +++ b/restore.arch.bash @@ -2,6 +2,12 @@ source ./restore.lib.bash +if [[ $? -ne 0 ]]; then + echo "Failed to source restore.lib.bash" + + exit 1 +fi + function cprint () { color="$1" shift diff --git a/restore.deb.bash b/restore.deb.bash index 7734c74..2d55cd1 100755 --- a/restore.deb.bash +++ b/restore.deb.bash @@ -1,6 +1,14 @@ #!/bin/bash + source ./restore.lib.bash + +if [[ $? -ne 0 ]]; then + echo "Failed to source restore.lib.bash" + + exit 1 +fi + export DEBIAN_FRONTEND=noninteractive # we call cp directly and check for a cp alias cpapp=$(which cp) diff --git a/restore.wrt.bash b/restore.wrt.bash index 35b0f8d..4ceb718 100755 --- a/restore.wrt.bash +++ b/restore.wrt.bash @@ -4,6 +4,11 @@ source ./restore.lib.bash +if [[ $? -ne 0 ]]; then + echo "Failed to source restore.lib.bash" + exit 1 +fi + function cprint () { color="$1" shift diff --git a/syssetup.bash b/syssetup.bash index ed430fb..efaca63 100755 --- a/syssetup.bash +++ b/syssetup.bash @@ -12,8 +12,21 @@ fi # Check the OS, it sets a env variable as a result source ./os_probe.bash + +if [[ $? -ne 0 ]]; then + echo "Failed to source os_probe.bash" + + exit 1 +fi + source ./check.bash +if [[ $? -ne 0 ]]; then + echo "Failed to source check.bash" + + exit 1 +fi + pkgsum="pkgsum" hashapp="sha256sum"