Fix 22 critical runtime errors from 'local' keyword used outside functions

Removed 'local' keyword from script-level variable declarations in:
- website-error-analyzer.sh (8 instances)
- wordpress-cron-manager.sh (3 instances)
- live-attack-monitor.sh (3 instances)
- live-attack-monitor-v2.sh (3 instances)
- acronis-uninstall.sh (3 instances)
- malware-scanner.sh (1 instance)
- acronis-troubleshoot.sh (1 instance)
- diagnostic-report.sh (1 instance)

The 'local' keyword can only be used inside bash functions.
Using it at script-level causes immediate runtime errors.
This commit is contained in:
cschantz
2025-12-30 18:38:59 -05:00
parent b3d31e838e
commit 77f91462e1
8 changed files with 396 additions and 159 deletions
+1 -1
View File
@@ -356,7 +356,7 @@ else
# Show recommendations
if [ ${#RECOMMENDATIONS[@]} -gt 0 ]; then
echo -e "${CYAN}${BOLD}Recommendations:${NC}"
local rec_num=1
rec_num=1
for rec in "${RECOMMENDATIONS[@]}"; do
echo -e " ${CYAN}${rec_num}.${NC} $rec"
((rec_num++))