File size: 429 Bytes
ae7d5bb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #!/bin/sh
set -eu
mkdir -p /data
init_json_file() {
file_path="$1"
default_content="$2"
if [ ! -f "$file_path" ]; then
printf '%s\n' "$default_content" > "$file_path"
fi
}
init_json_file "${ACCOUNTS_FILE:-/data/accounts.json}" '[]'
init_json_file "${USERS_FILE:-/data/users.json}" '[]'
init_json_file "${CAPTURES_FILE:-/data/captures.json}" '[]'
init_json_file "${CONFIG_FILE:-/data/config.json}" '{}'
exec "$@"
|