From 760d6b3f4cc49401eb09f1c1e82eeab54fcaa587 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sat, 20 Aug 2022 18:55:17 -0500 Subject: [PATCH] Add default location migration --- root/migrations/02-default-location | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 root/migrations/02-default-location diff --git a/root/migrations/02-default-location b/root/migrations/02-default-location new file mode 100644 index 0000000..3d3d2f8 --- /dev/null +++ b/root/migrations/02-default-location @@ -0,0 +1,10 @@ +#!/usr/bin/with-contenv bash + +DEFAULT_CONF="/config/nginx/site-confs/default.conf" +OLD_ROOT="root /app/snapdrop/client;" +NEW_ROOT="root /app/www/client;" + +if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}";then + echo "updating root in ${DEFAULT_CONF}" + sed -i "s|${OLD_ROOT}|${NEW_ROOT}|" "${DEFAULT_CONF}" +fi