Only if custom image is present

This commit is contained in:
Bob Mottram 2017-06-18 13:35:24 +01:00
parent d724d433fc
commit 9ce9d5dae4
1 changed files with 5 additions and 5 deletions

View File

@ -52,12 +52,12 @@ function qvitter_update_background {
if [ -d /var/www/${domain_name}/htdocs/local/plugins/Qvitter/img ]; then
if [ -f bg_custom.${ext} ]; then
cp bg_custom.${ext} /var/www/${domain_name}/htdocs/local/plugins/Qvitter/img
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
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
echo "\$config['site']['qvitter']['sitebackground'] = 'img/bg_custom.${ext}';" >> /var/www/${domain_name}/htdocs/config.php
fi
fi
}