Skip to content

Commit

Permalink
Merge pull request #25 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 44a6a5e + 1500497 commit d64f416
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 /usr/share/webapps/librespeed;"
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 d64f416

Please sign in to comment.