tangled
alpha
login
or
join now
dunkirk.sh
/
battleship-arena
1
fork
atom
a geicko-2 based round robin ranking system designed to test c++ battleship submissions
battleship.dunkirk.sh
1
fork
atom
overview
issues
pulls
pipelines
feat: add auto password for batch upload
dunkirk.sh
3 months ago
5ce1ddf5
e7654ddb
verified
This commit was signed with the committer's
known signature
.
dunkirk.sh
SSH Key Fingerprint:
SHA256:DqcG0RXYExE26KiWo3VxJnsxswN1QNfTBvB+bdSpk80=
+10
-5
1 changed file
expand all
collapse all
unified
split
scripts
batch-upload.sh
+10
-5
scripts/batch-upload.sh
···
6
6
HOST="localhost"
7
7
PORT="2222"
8
8
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
9
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
10
10
+
11
11
+
# Load from .env file if exists
12
12
+
if [ -f "$PROJECT_ROOT/.env" ]; then
13
13
+
export $(cat "$PROJECT_ROOT/.env" | grep -v '^#' | xargs)
14
14
+
fi
9
15
10
16
# Admin passcode (set via environment variable or use default)
11
17
ADMIN_PASSCODE="${BATTLESHIP_ADMIN_PASSCODE:-battleship-admin-override}"
···
54
60
continue
55
61
fi
56
62
57
57
-
# Use sshpass to provide password authentication
58
58
-
# If sshpass not available, use expect or manual password entry
63
63
+
# Use sshpass to provide password authentication automatically
59
64
if command -v sshpass &> /dev/null; then
60
60
-
sshpass -p "$ADMIN_PASSCODE" scp -P $PORT "$SCRIPT_DIR/test-submissions/$filename" "$username@$HOST:~/$filename" 2>&1 | grep -q "100%"
65
65
+
sshpass -p "$ADMIN_PASSCODE" scp -o StrictHostKeyChecking=no -P $PORT "$SCRIPT_DIR/test-submissions/$filename" "$username@$HOST:~/$filename" 2>&1 | grep -q "100%"
61
66
result=$?
62
67
else
63
63
-
echo " Using manual password authentication (enter passcode when prompted)"
64
64
-
echo " Password: $ADMIN_PASSCODE"
68
68
+
echo "❌ Error: sshpass not installed. Install with: brew install hudochenkov/sshpass/sshpass"
69
69
+
echo " Or set ADMIN_PASSCODE env var and enter manually when prompted"
65
70
scp -P $PORT "$SCRIPT_DIR/test-submissions/$filename" "$username@$HOST:~/$filename" 2>&1 | grep -q "100%"
66
71
result=$?
67
72
fi