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:
@@ -179,7 +179,7 @@ if [ "$remove_data" = "yes" ]; then
|
||||
|
||||
for dir in "${DATA_DIRS[@]}"; do
|
||||
if [ -d "$dir" ]; then
|
||||
local size=$(du -sh "$dir" 2>/dev/null | awk '{print $1}')
|
||||
size=$(du -sh "$dir" 2>/dev/null | awk '{print $1}')
|
||||
echo " Removing: $dir (${size})"
|
||||
rm -rf "$dir" 2>/dev/null
|
||||
fi
|
||||
@@ -202,7 +202,7 @@ echo -e "${GREEN}${BOLD}✓ Uninstallation Complete${NC}"
|
||||
echo ""
|
||||
|
||||
# Check if anything remains
|
||||
local remaining=0
|
||||
remaining=0
|
||||
|
||||
if systemctl list-unit-files | grep -q "acronis"; then
|
||||
echo -e "${YELLOW}⚠ Some service files may still be present${NC}"
|
||||
@@ -230,7 +230,7 @@ if [ "$remove_data" = "no" ]; then
|
||||
echo ""
|
||||
echo "Backup data and logs were kept as requested:"
|
||||
if [ -d "/var/lib/Acronis" ]; then
|
||||
local data_size=$(du -sh /var/lib/Acronis 2>/dev/null | awk '{print $1}')
|
||||
data_size=$(du -sh /var/lib/Acronis 2>/dev/null | awk '{print $1}')
|
||||
echo " Location: /var/lib/Acronis"
|
||||
echo " Size: $data_size"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user