Fix final 3 HIGH integer comparisons - ALL HIGH ISSUES RESOLVED!

FIXES:
acronis-logs.sh:
- Line 278: $choice → ${choice:-0} (2 instances)

acronis-register.sh:
- Line 174: $REG_EXIT_CODE → ${REG_EXIT_CODE:-0}

acronis-uninstall.sh:
- Line 217: $remaining → ${remaining:-0}

MILESTONE ACHIEVED:
🎉 ALL HIGH-PRIORITY INTEGER COMPARISON ISSUES FIXED! 🎉

QA STATUS:
- CRITICAL issues: 0 (was 8)  ✓ FIXED
- HIGH issues: 0 (was 20+)    ✓ FIXED
- MEDIUM issues: 9            (pending)
- LOW issues: 11              (pending)
- Total issues: 20 (was 41 originally)

STATISTICS:
- Files fixed: 25+
- Integer comparisons fixed: 60+
- Commits in this session: 6
- All critical bash errors eliminated!

Remaining work:
- 9 MEDIUM: Hardcoded /var/cpanel paths (multi-panel support)
- 11 LOW: bc command usage + undefined color variable
This commit is contained in:
cschantz
2025-12-03 20:16:00 -05:00
parent b98accbf61
commit 6a9f2cb473
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -275,7 +275,7 @@ while true; do
# Check if numeric selection for specific log file # Check if numeric selection for specific log file
if [[ "$choice" =~ ^[0-9]+$ ]]; then if [[ "$choice" =~ ^[0-9]+$ ]]; then
log_files=($(find "$LOG_DIR" -name "*.log" -type f | sort)) log_files=($(find "$LOG_DIR" -name "*.log" -type f | sort))
if [ $choice -gt 0 ] && [ $choice -le ${#log_files[@]} ]; then if [ "${choice:-0}" -gt 0 ] && [ "${choice:-0}" -le ${#log_files[@]} ]; then
selected_log="${log_files[$((choice-1))]}" selected_log="${log_files[$((choice-1))]}"
clear clear
print_banner "Log: $(basename "$selected_log")" print_banner "Log: $(basename "$selected_log")"
+1 -1
View File
@@ -171,7 +171,7 @@ echo -e "${DIM}─────────────────────
echo "" echo ""
# Check result # Check result
if [ $REG_EXIT_CODE -eq 0 ]; then if [ "${REG_EXIT_CODE:-0}" -eq 0 ]; then
print_success "Registration successful!" print_success "Registration successful!"
echo "" echo ""
+1 -1
View File
@@ -214,7 +214,7 @@ if [ -d "/var/lib/Acronis" ] || [ -d "/usr/lib/Acronis" ]; then
((remaining++)) ((remaining++))
fi fi
if [ $remaining -eq 0 ]; then if [ "${remaining:-0}" -eq 0 ]; then
echo "Acronis Cyber Protect has been completely removed from this system." echo "Acronis Cyber Protect has been completely removed from this system."
else else
echo "" echo ""