-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
34 lines (26 loc) · 1.01 KB
/
entrypoint.sh
File metadata and controls
34 lines (26 loc) · 1.01 KB
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
30
31
32
33
34
#!/bin/sh
set -e
echo "========================================="
echo "mTCP NetDrive Server Container"
echo "========================================="
echo "Port: ${NETDRIVE_PORT}"
echo "Images Directory: ${NETDRIVE_IMAGES_DIR}"
echo "========================================="
# Ensure images directory exists
mkdir -p "${NETDRIVE_IMAGES_DIR}"
# Build serve command arguments
# Format: netdrive serve [flags]
SERVE_ARGS="-headless"
if [ -n "${NETDRIVE_PORT}" ]; then
SERVE_ARGS="${SERVE_ARGS} -port ${NETDRIVE_PORT}"
fi
if [ -n "${NETDRIVE_IMAGES_DIR}" ]; then
SERVE_ARGS="${SERVE_ARGS} -image_dir ${NETDRIVE_IMAGES_DIR}"
fi
echo "Starting NetDrive server with: serve ${SERVE_ARGS}"
echo "Available disk images:"
ls -lh "${NETDRIVE_IMAGES_DIR}"/ 2>/dev/null || echo " (none yet)"
echo "========================================="
# Execute NetDrive server with serve command and arguments
# Note: -headless flag is required for Docker (non-interactive mode)
exec /usr/local/bin/netdrive-server serve ${SERVE_ARGS}