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

Set qvitter background

parent 2a0ea674
No related branches found
No related tags found
No related merge requests found
......@@ -87,6 +87,31 @@ function pleroma_set_background_image_from_url {
echo "\$config['site']['qvitter']['sitebackground'] = 'img/bg_custom.${ext}';" >> /var/www/${domain_name}/htdocs/config.php
fi
fi
else
# qvitter background
if [ -d /var/www/${domain_name}/htdocs/local/plugins/Qvitter/img ]; then
cd /var/www/${domain_name}/htdocs/local/plugins/Qvitter/img
# remove any existing image
if [ -f bg_custom.${ext} ]; then
rm bg_custom.${ext}
fi
# get the new image
wget "$url" -O bg_custom.${ext}
if [ ! -f bg_custom.${ext} ]; then
echo "$url"
echo $'Custom background image for Qvitter could not be downloaded'
echo "3"
return
fi
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"
......
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