瀏覽代碼

Prevent the pleroma background from getting overwritten during upgrades

Bob Mottram 7 年之前
父節點
當前提交
2374a4f746
共有 1 個檔案被更改,包括 4 行新增2 行删除
  1. 4
    2
      src/freedombone-utils-gnusocialtools

+ 4
- 2
src/freedombone-utils-gnusocialtools 查看文件

@@ -289,10 +289,12 @@ function install_gnusocial_default_background {
289 289
     fi
290 290
 
291 291
     if [ -f ~/freedombone/img/backgrounds/${gnusocial_type}.jpg ]; then
292
-        cp ~/freedombone/img/backgrounds/${gnusocial_type}.jpg $basedir/static/bg.jpg
292
+        cp ~/freedombone/img/backgrounds/${gnusocial_type}.jpg $basedir/static/bg_custom.jpg
293
+        sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.jpg\",|g" $basedir/static/config.json
293 294
     else
294 295
         if [ -f /home/$MY_USERNAME/freedombone/img/backgrounds/${gnusocial_type}.jpg ]; then
295
-            cp /home/$MY_USERNAME/freedombone/img/backgrounds/${gnusocial_type}.jpg $basedir/static/bg.jpg
296
+            cp /home/$MY_USERNAME/freedombone/img/backgrounds/${gnusocial_type}.jpg $basedir/static/bg_custom.jpg
297
+            sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.jpg\",|g" $basedir/static/config.json
296 298
         fi
297 299
     fi
298 300
 }