Implemented Failed message in error function

This commit is contained in:
Kevin Veen-Birkenbach 2020-05-15 11:16:22 +02:00
parent f771e581f8
commit 3ae8777075
2 changed files with 9 additions and 3 deletions

View File

@ -58,7 +58,13 @@ success(){
} }
error(){ error(){
message "${COLOR_RED}" "ERROR" "$1 -> Leaving program." if [ -z "$1" ]
then
message="Failed."
else
message="$1"
fi
message "${COLOR_RED}" "ERROR" "$message -> Leaving program."
if declare -f "destructor" > /dev/null if declare -f "destructor" > /dev/null
then then
info "Calling destructor..." info "Calling destructor..."

View File

@ -41,12 +41,12 @@ source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh
info "Making mount dir..." && info "Making mount dir..." &&
mkdir -p /mnt/raspbian || mkdir -p /mnt/raspbian ||
error "Failed." error
info "Mount partitions..." info "Mount partitions..."
mount -o rw "$1""2" /mnt/raspbian && mount -o rw "$1""2" /mnt/raspbian &&
mount -o rw "$1""1" /mnt/raspbian/boot || mount -o rw "$1""1" /mnt/raspbian/boot ||
error "Failed." error
info "Mount binds..." && info "Mount binds..." &&
mount --bind /dev /mnt/raspbian/dev/ && mount --bind /dev /mnt/raspbian/dev/ &&