Files
bd2/tools/server/bd2-docker-entrypoint.sh
T
Flechazo 04296dc409 fix(all): use explicit configuration and repair update status
Remove redundant environment overrides, unify plugin configuration, and fix cross-drive downloads.

Track completed update checks and bundled schedule identities. Restore the previous GameData contract for update verification.
2026-10-16 23:09:15 +08:00

32 lines
919 B
Bash

#!/bin/sh
set -eu
data_dir=/app/data
update_config=
next=
for argument in "$@"; do
if [ -n "$next" ]; then
case "$next" in
data) data_dir=$argument ;;
update) update_config=$argument ;;
esac
next=
continue
fi
case "$argument" in
--data-dir|-data-dir) next=data ;;
--data-dir=*|-data-dir=*) data_dir=${argument#*=} ;;
--update-config|-update-config) next=update ;;
--update-config=*|-update-config=*) update_config=${argument#*=} ;;
esac
done
[ -z "$next" ] || { printf '%s\n' 'Missing configuration path argument' >&2; exit 2; }
if [ -z "$update_config" ]; then
update_config=$data_dir/config/updates.json
if [ ! -e "$update_config" ]; then
mkdir -p "$(dirname "$update_config")"
(umask 077; set -C; printf '%s\n' '{"method":"docker"}' >"$update_config")
fi
fi
exec /app/bd2server "$@"