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