18 lines
418 B
Bash
Executable File
18 lines
418 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
DATA_DIR="${RUST_PROXY_DATA_DIR:-/var/lib/rustproxy}"
|
|
RUSTPROXY_UID="${RUSTPROXY_UID:-10001}"
|
|
RUSTPROXY_GID="${RUSTPROXY_GID:-10001}"
|
|
|
|
if [ "$(id -u)" = "0" ]; then
|
|
mkdir -p "$DATA_DIR"
|
|
|
|
chown "$RUSTPROXY_UID:$RUSTPROXY_GID" "$DATA_DIR"
|
|
chmod 0700 "$DATA_DIR"
|
|
|
|
exec gosu "$RUSTPROXY_UID:$RUSTPROXY_GID" \
|
|
/usr/local/bin/rust-proxy "$@"
|
|
fi
|
|
|
|
exec /usr/local/bin/rust-proxy "$@" |