diff --git a/examples/crash_reporter/backend/scripts/apply-be-port80-nginx.sh b/examples/crash_reporter/backend/scripts/apply-be-port80-nginx.sh index 1879a2b..35a42c6 100755 --- a/examples/crash_reporter/backend/scripts/apply-be-port80-nginx.sh +++ b/examples/crash_reporter/backend/scripts/apply-be-port80-nginx.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash # Replace BE apps.conf listen-80 block from repo fragment (run on machine with BE mount write access). set -euo pipefail -ROOT="$(cd "$(dirname "$0")/../../.." && pwd)" -REPO_ROOT="$(cd "$ROOT/../.." && pwd)" -FRAG="$ROOT/crash_reporter/backend/nginx.apps-port80.fragment" +REPO_ROOT="$(cd "$(dirname "$0")/../../../.." && pwd)" +EXAMPLES="$REPO_ROOT/examples" +FRAG="$EXAMPLES/crash_reporter/backend/nginx.apps-port80.fragment" APPS_CONF="${1:-$REPO_ROOT/tmp/BE_alpine/etc/nginx/conf.d/apps.conf}" if [[ ! -f "$FRAG" || ! -f "$APPS_CONF" ]]; then echo "Usage: $0 [path/to/apps.conf]" >&2 diff --git a/examples/crash_reporter/backend/scripts/apply-build-nginx-fix.sh b/examples/crash_reporter/backend/scripts/apply-build-nginx-fix.sh index f42aaeb..92886a1 100755 --- a/examples/crash_reporter/backend/scripts/apply-build-nginx-fix.sh +++ b/examples/crash_reporter/backend/scripts/apply-build-nginx-fix.sh @@ -1,17 +1,18 @@ #!/usr/bin/env bash # Fix builder nginx on sshfs mounts + optional reload on hosts. set -euo pipefail -REPO="$(cd "$(dirname "$0")/../../.." && pwd)" -BE_NGINX="${BE_NGINX:-$REPO/../../../tmp/BE_alpine/etc/nginx/conf.d}" -FE_NGINX="${FE_NGINX:-$REPO/../../../tmp/FE_gentoo/etc/nginx}" +REPO_ROOT="$(cd "$(dirname "$0")/../../../.." && pwd)" +BE_NGINX="${BE_NGINX:-$REPO_ROOT/tmp/BE_alpine/etc/nginx/conf.d}" +FE_NGINX="${FE_NGINX:-$REPO_ROOT/tmp/FE_gentoo/etc/nginx}" +EXAMPLES="$REPO_ROOT/examples" -install -D -m 0644 "$REPO/crash_reporter/backend/nginx.apps-builder.frag" \ +install -D -m 0644 "$EXAMPLES/crash_reporter/backend/nginx.apps-builder.frag" \ "$BE_NGINX/apps_builder.frag" -install -D -m 0644 "$REPO/crash_reporter/backend/nginx.fe-apps.conf.fragment" \ +install -D -m 0644 "$EXAMPLES/crash_reporter/backend/nginx.fe-apps.conf.fragment" \ "$FE_NGINX/apps.conf" if [[ "${1:-}" == "--port80" ]]; then - "$REPO/crash_reporter/backend/scripts/apply-be-port80-nginx.sh" \ + "$EXAMPLES/crash_reporter/backend/scripts/apply-be-port80-nginx.sh" \ "$BE_NGINX/apps.conf" fi