Skip to content

Commit

Permalink
Merge pull request #78 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 29, 2023
2 parents b4a4dda + 1fd2cec commit 581b64c
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/grocy/public;"
NEW_ROOT="root /app/www/public;"

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

0 comments on commit 581b64c

Please sign in to comment.