Quote all variables in numeric comparisons for safety
This commit is contained in:
@@ -509,7 +509,7 @@ if [ -n "$FIRST_WP" ]; then
|
||||
crontab -u "$WP_USER" -l 2>/dev/null | head -10 >> "$RESULTS_FILE"
|
||||
else
|
||||
CRON_ERR=$?
|
||||
if [ $CRON_ERR -eq 1 ]; then
|
||||
if [ "$CRON_ERR" -eq 1 ]; then
|
||||
test_info "User $WP_USER has no crontab (OK - means empty)"
|
||||
else
|
||||
test_warn "Cannot read crontab for $WP_USER (exit code: $CRON_ERR)"
|
||||
@@ -791,7 +791,7 @@ TOTAL TESTS: $TOTAL
|
||||
Completed: $(date)
|
||||
EOF
|
||||
|
||||
if [ $FAIL -eq 0 ]; then
|
||||
if [ "$FAIL" -eq 0 ]; then
|
||||
echo -e "${GREEN}✓ ALL CRITICAL TESTS PASSED${NC}"
|
||||
echo "✓ ALL CRITICAL TESTS PASSED" >> "$RESULTS_FILE"
|
||||
echo ""
|
||||
|
||||
@@ -335,7 +335,7 @@ if command -v mysql &> /dev/null; then
|
||||
test_info "Databases without underscores: $NO_UNDERSCORES"
|
||||
|
||||
# Check if databases follow username_ pattern or no prefix
|
||||
if [ $NO_UNDERSCORES -gt 0 ]; then
|
||||
if [ "$NO_UNDERSCORES" -gt 0 ]; then
|
||||
test_info "Found databases without underscores (suggests NO PREFIX pattern)"
|
||||
test_info "Sample databases without prefix:"
|
||||
echo "$DB_LIST" | grep -v "_" | grep -v "test" | head -5 >> "$RESULTS_FILE"
|
||||
@@ -477,7 +477,7 @@ if command -v crontab &> /dev/null; then
|
||||
crontab -u "$CRON_USER" -l 2>/dev/null >> "$RESULTS_FILE"
|
||||
else
|
||||
CRON_READ_ERR=$?
|
||||
if [ $CRON_READ_ERR -eq 1 ]; then
|
||||
if [ "$CRON_READ_ERR" -eq 1 ]; then
|
||||
test_info "User $CRON_USER has no crontab (this is OK - means empty)"
|
||||
else
|
||||
test_warn "Cannot read crontab for $CRON_USER (exit code: $CRON_READ_ERR)"
|
||||
@@ -511,7 +511,7 @@ if command -v crontab &> /dev/null; then
|
||||
fi
|
||||
|
||||
# Test plesk bin cron if available
|
||||
if [ $HAS_PLESK_CRON -eq 1 ] && [ -n "$TEST_DOMAIN" ]; then
|
||||
if [ "$HAS_PLESK_CRON" -eq 1 ] && [ -n "$TEST_DOMAIN" ]; then
|
||||
test_info "Testing Plesk cron management for domain: $TEST_DOMAIN"
|
||||
|
||||
# Try to list cron jobs via plesk
|
||||
@@ -535,7 +535,7 @@ if command -v crontab &> /dev/null; then
|
||||
if [ -n "$CRON_USER" ]; then
|
||||
echo "RECOMMENDED: Use standard crontab -u $CRON_USER for cron jobs" >> "$RESULTS_FILE"
|
||||
fi
|
||||
if [ $HAS_PLESK_CRON -eq 1 ]; then
|
||||
if [ "$HAS_PLESK_CRON" -eq 1 ]; then
|
||||
echo "ALTERNATIVE: Plesk bin cron available but may be for web UI management only" >> "$RESULTS_FILE"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user