Skip to content
Snippets Groups Projects
Commit 2b091cf5 authored by Bob Mottram's avatar Bob Mottram
Browse files

Check that background field exists

parent 49e69bec
No related branches found
No related tags found
No related merge requests found
......@@ -165,7 +165,9 @@ function pleroma_set_background_image_from_url {
chown www-data:www-data "static/bg_custom.${ext}"
sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.${ext}\",|g" static/config.json
if [ -f "$pleroma_secret" ]; then
sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.${ext}\",|g" "$pleroma_secret"
if grep -q "\"background\":" "$pleroma_secret"; then
sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.${ext}\",|g" "$pleroma_secret"
fi
fi
fi
if [ -d priv/static/static ]; then
......@@ -173,7 +175,9 @@ function pleroma_set_background_image_from_url {
chown www-data:www-data "priv/static/static/bg_custom.${ext}"
sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.${ext}\",|g" priv/static/static/config.json
if [ -f "$pleroma_secret" ]; then
sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.${ext}\",|g" "$pleroma_secret"
if grep -q "\"background\":" "$pleroma_secret"; then
sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.${ext}\",|g" "$pleroma_secret"
fi
fi
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment