Explorar el Código

Set qvitter background

Bob Mottram hace 8 años
padre
commit
a59923cc6e
Se han modificado 1 ficheros con 25 adiciones y 0 borrados
  1. 25
    0
      src/freedombone-utils-gnusocialtools

+ 25
- 0
src/freedombone-utils-gnusocialtools Ver fichero

@@ -87,6 +87,31 @@ function pleroma_set_background_image_from_url {
87 87
                     echo "\$config['site']['qvitter']['sitebackground'] = 'img/bg_custom.${ext}';" >> /var/www/${domain_name}/htdocs/config.php
88 88
                 fi
89 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 115
         fi
91 116
     else
92 117
         echo "2"