Fix menu system error handling and OS detection

- Add comprehensive error handling to menu.sh to prevent crashes when scripts fail
- Fix OS detection in common.sh for lsb_release output parsing
- Modify preflight.sh to run all checks without early exit on failures
- Ensure menu navigation remains stable during testing phase
This commit is contained in:
Kelin
2026-01-29 21:42:37 -05:00
parent 9d320bf9f9
commit b2436bd81d
3 changed files with 49 additions and 42 deletions

View File

@@ -232,7 +232,7 @@ check_user_permissions() {
return 2
fi
if ! sudo -n true 2>/dev/null; then
if ! sudo -n true 2>/dev/null && ! sudo -l >/dev/null 2>&1; then
print_error "User does not have sudo access"
print_error "Please ensure your user can run sudo commands"
return 1
@@ -319,7 +319,8 @@ main() {
local warnings=0
local failed=0
# Run all checks
# Run all checks (disable strict error checking for this loop)
set +e
local checks=(
"check_os_compatibility"
"check_system_resources"
@@ -346,6 +347,7 @@ main() {
((failed++))
fi
done
set -e # Re-enable strict error checking
echo ""
print_info "Pre-flight validation complete!"