ソースを参照

Check tahoelafs server creation

Bob Mottram 8 年 前
コミット
10258bd293
共有1 個のファイルを変更した15 個の追加11 個の削除を含む
  1. 15
    11
      src/freedombone-app-tahoelafs

+ 15
- 11
src/freedombone-app-tahoelafs ファイルの表示

488
         return
488
         return
489
     fi
489
     fi
490
 
490
 
491
-    if grep -q "$public_key" $tahoelafs_storage_file; then
492
-        return
493
-    fi
494
-    if [ ! -f $tahoelafs_storage_file ]; then
495
-        echo 'storage:' > $tahoelafs_storage_file
491
+    if [ ! -f ${tahoelafs_storage_file} ]; then
492
+        echo 'storage:' > ${tahoelafs_storage_file}
496
     else
493
     else
497
-        echo '# storage' >> $tahoelafs_storage_file
494
+        if grep -q "${public_key}" ${tahoelafs_storage_file}; then
495
+            return
496
+        fi
497
+        echo '# storage' >> ${tahoelafs_storage_file}
498
     fi
498
     fi
499
-    echo "  $public_key" >> $tahoelafs_storage_file
500
-    echo "    ann:" >> $tahoelafs_storage_file
501
-    echo "      nickname: $nick" >> $tahoelafs_storage_file
502
-    echo "      anonymous-storage-FURL: $furl" >> $tahoelafs_storage_file
503
-    chown tahoelafs:debian-tor $tahoelafs_storage_file
499
+    echo "  ${public_key}" >> ${tahoelafs_storage_file}
500
+    echo "    ann:" >> ${tahoelafs_storage_file}
501
+    echo "      nickname: ${nick}" >> ${tahoelafs_storage_file}
502
+    echo "      anonymous-storage-FURL: ${furl}" >> ${tahoelafs_storage_file}
503
+    chown tahoelafs:debian-tor ${tahoelafs_storage_file}
504
 
504
 
505
     if ! grep -q "HidServAuth ${storage_hostname}" /etc/tor/torrc; then
505
     if ! grep -q "HidServAuth ${storage_hostname}" /etc/tor/torrc; then
506
         echo "HidServAuth ${storage_hostname}" >> /etc/tor/torrc
506
         echo "HidServAuth ${storage_hostname}" >> /etc/tor/torrc
618
     create_tahoelafs_stealth_node /home/tahoelafs/storage /home/tahoelafs/client ${node_nick} ${client_nick}
618
     create_tahoelafs_stealth_node /home/tahoelafs/storage /home/tahoelafs/client ${node_nick} ${client_nick}
619
 
619
 
620
     add_tahoelafs_server "$(get_tahoelafs_storage_hostname)" "$(get_tahoelafs_public_key)" "${node_nick}" "$(get_tahoelafs_furl)"
620
     add_tahoelafs_server "$(get_tahoelafs_storage_hostname)" "$(get_tahoelafs_public_key)" "${node_nick}" "$(get_tahoelafs_furl)"
621
+    if ! grep -q "HidServAuth $(get_tahoelafs_storage_hostname)" /etc/tor/torrc; then
622
+        echo $'Unable to create tahoelafs server'
623
+        exit 738752
624
+    fi
621
 
625
 
622
     # start the storage node
626
     # start the storage node
623
     su -c '/home/tahoelafs/tahoelafs/venv/bin/python2 /home/tahoelafs/tahoelafs/venv/bin/tahoe start /home/tahoelafs/storage' - tahoelafs
627
     su -c '/home/tahoelafs/tahoelafs/venv/bin/python2 /home/tahoelafs/tahoelafs/venv/bin/tahoe start /home/tahoelafs/storage' - tahoelafs