Merge pull request #61 from linuxserver/quiet-migration

only run migration if conf exists
This commit is contained in:
Eric Nemchik 2023-11-29 08:31:10 -06:00 committed by GitHub
commit 434bb2d8b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,7 @@ DEFAULT_CONF="/config/nginx/site-confs/default.conf"
OLD_ROOT="root /usr/share/webapps/freshrss/p;"
NEW_ROOT="root /app/www/p;"
if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}"; then
if [[ -f "${DEFAULT_CONF}" ]] && 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