[IMP] add external command verification at startup

Add check_required_commands() function to verify that all required
external tools are available before the script begins execution:
- docker: Container runtime
- compose: Docker compose wrapper (0k-scripts)
- sudo: Required for filestore operations

Benefits:
- Fails fast with a clear error message listing missing commands
- Prevents cryptic 'command not found' errors mid-execution
- Documents script dependencies explicitly
- Called immediately after argument validation in upgrade.sh
This commit is contained in:
Stéphan Sainléger
2026-02-02 18:00:55 +01:00
parent 4bdedf3759
commit 00c12769bc
2 changed files with 17 additions and 0 deletions

View File

@@ -29,6 +29,8 @@ if [[ $# -lt 4 ]]; then
usage
fi
check_required_commands
readonly ORIGIN_VERSION="$1"
readonly FINAL_VERSION="$2"
readonly ORIGIN_DB_NAME="$3"