17 lines
374 B
Bash
17 lines
374 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [ "${XRAY_ENABLED:-1}" != "1" ]; then
|
|
echo "Xray service disabled by XRAY_ENABLED=${XRAY_ENABLED}." >&2
|
|
exit 0
|
|
fi
|
|
|
|
mkdir -p /etc/services.d/xray
|
|
cat >/etc/services.d/xray/run <<'EOF'
|
|
#!/command/with-contenv bash
|
|
set -euo pipefail
|
|
|
|
exec bash /usr/local/bin/scripts/xray-service-run.sh
|
|
EOF
|
|
chmod 0755 /etc/services.d/xray/run
|