docker-snapdrop/root/migrations/02-default-location
Eric Nemchik c39cf022c3
Dont show error if default site conf does not exist
Default site conf will be created later during init. The migration is only meant to fix pre-existing user files.
2023-05-30 09:06:10 -05:00

12 lines
345 B
Plaintext

#!/usr/bin/with-contenv bash
# shellcheck shell=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}" 2>/dev/null; then
echo "updating root in ${DEFAULT_CONF}"
sed -i "s|${OLD_ROOT}|${NEW_ROOT}|" "${DEFAULT_CONF}"
fi