#!/bin/sh # Container entrypoint for awg_profiler. # # The AmneziaWG stack is baked into the image at build time, so the profiler's # "install-deps" step is a no-op here. We seed the deps-installed flag that # init-server / the web setup wizard require, enable IP forwarding, then hand # off to the profiler with whatever command was passed (defaults to `web`). set -e : "${AWG_PROFILER_DIR:=/data}" export AWG_PROFILER_DIR mkdir -p "$AWG_PROFILER_DIR" /etc/amnezia/amneziawg # Seed the deps-installed state so init-server doesn't demand `install-deps` # (packages are already present in the image). Written only if absent so it # never clobbers real state on a persistent volume. STATE_FILE="$AWG_PROFILER_DIR/awg_state.json" if [ ! -f "$STATE_FILE" ]; then cat > "$STATE_FILE" </dev/null 2>&1 || true exec /usr/local/bin/awg_profiler "$@"