Skip to content

Commit a6801f2

Browse files
committed
only run migration if conf exists
redirect stderr to /dev/null Signed-off-by: Eric Nemchik <[email protected]>
1 parent 152f64b commit a6801f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: root/migrations/02-default-location

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ DEFAULT_CONF="/config/nginx/site-confs/default.conf"
55
OLD_ROOT="root /var/www/html/public;"
66
NEW_ROOT="root /app/www/public;"
77

8-
if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}"; then
8+
if [[ -f "${DEFAULT_CONF}" ]] && grep -q "${OLD_ROOT}" "${DEFAULT_CONF}" 2>/dev/null; then
99
echo "updating root in ${DEFAULT_CONF}"
1010
sed -i "s|${OLD_ROOT}|${NEW_ROOT}|" "${DEFAULT_CONF}"
1111
fi

0 commit comments

Comments
 (0)