Set qvitter background
This commit is contained in:
parent
2a0ea6747a
commit
a59923cc6e
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue