Skip to content

Commit

Permalink
only run migration if conf exists
Browse files Browse the repository at this point in the history
redirect stderr to /dev/null

Signed-off-by: Eric Nemchik <eric@nemchik.com>
  • Loading branch information
nemchik committed Nov 25, 2023
1 parent f194140 commit 79024a6
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/projectsend;"
NEW_ROOT="root /app/www/public;"

if [[ -f "${DEFAULT_CONF}" ]] && 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 79024a6

Please sign in to comment.