Skip to content

Commit

Permalink
Merge pull request #31 from linuxserver/quiet-migration
Browse files Browse the repository at this point in the history
only run migration if conf exists
  • Loading branch information
nemchik authored Nov 28, 2023
2 parents 6fd7e54 + ca685c3 commit 4b81ec5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion root/migrations/02-default-location
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DEFAULT_CONF="/config/nginx/site-confs/default.conf"
OLD_ROOT="root /app/phpmyadmin;"
NEW_ROOT="root /app/www/public;"

if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}" 2>/dev/null; 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

0 comments on commit 4b81ec5

Please sign in to comment.