Browse Source

Set qvitter background

Bob Mottram 8 years ago
parent
commit
a59923cc6e
1 changed files with 25 additions and 0 deletions
  1. 25
    0
      src/freedombone-utils-gnusocialtools

+ 25
- 0
src/freedombone-utils-gnusocialtools View File

87
                     echo "\$config['site']['qvitter']['sitebackground'] = 'img/bg_custom.${ext}';" >> /var/www/${domain_name}/htdocs/config.php
87
                     echo "\$config['site']['qvitter']['sitebackground'] = 'img/bg_custom.${ext}';" >> /var/www/${domain_name}/htdocs/config.php
88
                 fi
88
                 fi
89
             fi
89
             fi
90
+        else
91
+            # qvitter background
92
+            if [ -d /var/www/${domain_name}/htdocs/local/plugins/Qvitter/img ]; then
93
+                cd /var/www/${domain_name}/htdocs/local/plugins/Qvitter/img
94
+
95
+                # remove any existing image
96
+                if [ -f bg_custom.${ext} ]; then
97
+                    rm bg_custom.${ext}
98
+                fi
99
+
100
+                # get the new image
101
+                wget "$url" -O bg_custom.${ext}
102
+                if [ ! -f bg_custom.${ext} ]; then
103
+                    echo "$url"
104
+                    echo $'Custom background image for Qvitter could not be downloaded'
105
+                    echo "3"
106
+                    return
107
+                fi
108
+                if ! grep -q "bg_custom.${ext}" /var/www/${domain_name}/htdocs/config.php; then
109
+                    if grep -q 'sitebackground' /var/www/${domain_name}/htdocs/config.php; then
110
+                        sed -i '/sitebackground/d' /var/www/${domain_name}/htdocs/config.php
111
+                    fi
112
+                    echo "\$config['site']['qvitter']['sitebackground'] = 'img/bg_custom.${ext}';" >> /var/www/${domain_name}/htdocs/config.php
113
+                fi
114
+            fi
90
         fi
115
         fi
91
     else
116
     else
92
         echo "2"
117
         echo "2"