Quote all variables in numeric comparisons for safety

This commit is contained in:
cschantz
2025-11-20 15:43:20 -05:00
parent 38a2df4525
commit eca362da07
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -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