]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
add check command yq
authorBastian Dehn <hhaalo@arcor.de>
Sat, 24 May 2025 10:13:43 +0000 (12:13 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 24 May 2025 10:13:43 +0000 (12:13 +0200)
backup

diff --git a/backup b/backup
index 923d205b00566b3700c957c66594628c9c99064f..191419afbf9be083f34c7e31b3306da22c098de2 100755 (executable)
--- a/backup
+++ b/backup
@@ -1,5 +1,14 @@
 #!/bin/bash
-# vim: tabstop=8 colorcolumn=80
+
+errlog()
+{
+       local lastexit=$?
+       local msg="$1"
+
+       echo "❌ ERROR: $msg"
+       echo "🛑 EXIT $lastexit"
+       return $lastext
+}
 
 ## @fn usage()
 ## @brief Anzeige von der Hilfe
@@ -449,6 +458,9 @@ main()
        LIGHTPURPLE="\e[1;35m"
        LIGHTGREEN="\e[1;32m"
        RESET="\e[0m"
+
+       command -v yq > /dev/null || errlog "command yq not found" || return $?
+
        head -2 license
        echo
        ReadArguments $*