-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathentrypoint.sh
More file actions
29 lines (21 loc) · 1006 Bytes
/
entrypoint.sh
File metadata and controls
29 lines (21 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
LOG_DIR="/logs"
mkdir -p "$LOG_DIR"
LOG_FILE="${LOG_DIR}/sqlancer.log"
echo "=== SQLancer container start ==="
echo "Waiting for DB to become healthy..."
cd /root/sqlancer/target || { echo "Missing target directory"; exit 1; }
# Wait for the DB container to become healthy
for i in {1..60}; do
STATUS=$(docker inspect --format='{{.State.Health.Status}}' "$SQLANCER_HOST" 2>/dev/null || echo "unknown")
if [ "$STATUS" = "healthy" ]; then
break
fi
sleep 1
done
CMD="java -jar sqlancer-*.jar --num-threads \"$SQLANCER_THREADS\" --timeout-seconds \"$SQLANCER_TIMEOUT\" --username \"$SQLANCER_USERNAME\" --password \"$SQLANCER_PASSWORD\" --host \"$SQLANCER_HOST\" \"$SQLANCER_DBMS\" --oracle \"$SQLANCER_ORACLE\""
# Show command to console + log file
echo "Running: $CMD" | tee -a "$LOG_FILE"
# Run command: log everything, show only stats to console
eval "$CMD" 2>&1 | tee -a "$LOG_FILE" | grep --line-buffered "Executed"
echo "[INFO] SQLancer finished. Logs saved to $LOG_DIR"