瀏覽代碼

Set temp directory for matrix upgrades

Bob Mottram 6 年之前
父節點
當前提交
7a6c52b487
共有 1 個檔案被更改,包括 10 行新增0 行删除
  1. 10
    0
      src/freedombone-app-matrix

+ 10
- 0
src/freedombone-app-matrix 查看文件

@@ -418,6 +418,11 @@ function upgrade_matrix {
418 418
     function_check set_repo_commit
419 419
     set_repo_commit /etc/matrix "matrix commit" "$MATRIX_COMMIT" $MATRIX_REPO
420 420
     cd /etc/matrix || exit 62476724
421
+    if [ ! -d /etc/matrix/tmp ]; then
422
+        mkdir /etc/matrix/tmp
423
+    fi
424
+    export TMPDIR=/etc/matrix/tmp
425
+
421 426
     pip install --upgrade --process-dependency-links .
422 427
     pip install --upgrade --force "pynacl>=1.2.1"
423 428
 
@@ -434,6 +439,11 @@ function upgrade_matrix {
434 439
     fi
435 440
     systemctl start turn
436 441
     systemctl start matrix
442
+
443
+    export TMPDIR=/tmp
444
+    if [ -d /etc/matrix/tmp ]; then
445
+        rm -rf /etc/matrix/tmp/*
446
+    fi
437 447
 }
438 448
 
439 449
 function backup_local_matrix {