Also set qvitter background

This commit is contained in:
Bob Mottram 2017-04-22 18:57:43 +01:00
parent 3a09c0ebf2
commit 2a0ea6747a
1 changed files with 11 additions and 0 deletions

View File

@ -76,6 +76,17 @@ function pleroma_set_background_image_from_url {
fi
sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.${ext}\",|g" config.json
# update the qvitter background
if [ -d /var/www/${domain_name}/htdocs/local/plugins/Qvitter/img ]; then
cp bg_custom.${ext} /var/www/${domain_name}/htdocs/local/plugins/Qvitter/img
if ! grep -q "bg_custom.${ext}" /var/www/${domain_name}/htdocs/config.php; then
if grep -q 'sitebackground' /var/www/${domain_name}/htdocs/config.php; then
sed -i '/sitebackground/d' /var/www/${domain_name}/htdocs/config.php
fi
echo "\$config['site']['qvitter']['sitebackground'] = 'img/bg_custom.${ext}';" >> /var/www/${domain_name}/htdocs/config.php
fi
fi
fi
else
echo "2"