Browse Source

Install once only

Bob Mottram 9 years ago
parent
commit
259dbe47b5
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      src/freedombone

+ 8
- 0
src/freedombone View File

@@ -3524,13 +3524,20 @@ function install_tor {
3524 3524
     if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
3525 3525
         return
3526 3526
     fi
3527
+    if grep -Fxq "install_tor" $COMPLETION_FILE; then
3528
+        return
3529
+    fi
3527 3530
     apt-get -y install tor
3531
+    echo 'install_tor' >> $COMPLETION_FILE
3528 3532
 }
3529 3533
 
3530 3534
 function enable_ssh_via_onion {
3531 3535
     if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
3532 3536
         return
3533 3537
     fi
3538
+    if grep -Fxq "enable_ssh_via_onion" $COMPLETION_FILE; then
3539
+        return
3540
+    fi
3534 3541
     apt-get -y install tor connect-proxy
3535 3542
     if ! grep -q 'Host *.onion' /home/$MY_USERNAME/.ssh/config; then
3536 3543
         if [ ! -d /home/$MY_USERNAME/.ssh ]; then
@@ -3548,6 +3555,7 @@ function enable_ssh_via_onion {
3548 3555
         echo 'Host *.onion' >> /root/.ssh/config
3549 3556
         echo 'ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p' >> /root/.ssh/config
3550 3557
     fi
3558
+    echo 'enable_ssh_via_onion' >> $COMPLETION_FILE
3551 3559
 }
3552 3560
 
3553 3561
 function install_editor {