浏览代码

Use reload rather than restart to avoid ssh disconnections

Bob Mottram 8 年前
父节点
当前提交
44a4957af8
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5
    5
      src/freedombone-utils-onion

+ 5
- 5
src/freedombone-utils-onion 查看文件

@@ -41,8 +41,8 @@ function wait_for_onion_service {
41 41
     done
42 42
 
43 43
     if [ ! -f /var/lib/tor/hidden_service_${onion_service_name}/hostname ]; then
44
-        # restart and try a second time
45
-        systemctl restart tor
44
+        # reload and try a second time
45
+        systemctl reload tor
46 46
         sleep_ctr=0
47 47
         while [ ! -f /var/lib/tor/hidden_service_${onion_service_name}/hostname ]; do
48 48
             sleep 1
@@ -72,7 +72,7 @@ function remove_onion_service {
72 72
         shred -zu /var/lib/tor/hidden_service_${onion_service_name}/*
73 73
         rm -rf /var/lib/tor/hidden_service_${onion_service_name}
74 74
     fi
75
-    systemctl restart tor
75
+    systemctl reload tor
76 76
 }
77 77
 
78 78
 function add_onion_service {
@@ -94,7 +94,7 @@ function add_onion_service {
94 94
         echo "HiddenServicePort ${onion_service_port_from} 127.0.0.1:${onion_service_port_to}" >> /etc/tor/torrc
95 95
     fi
96 96
 
97
-    systemctl restart tor
97
+    systemctl reload tor
98 98
 
99 99
     function_check wait_for_onion_service
100 100
     wait_for_onion_service ${onion_service_name}
@@ -253,7 +253,7 @@ function resolve_dns_via_tor {
253 253
         echo 'DNSPort 53' >> /etc/tor/torrc
254 254
         echo 'AutomapHostsOnResolve 1' >> /etc/tor/torrc
255 255
         echo 'AutomapHostsSuffixes .exit,.onion' >> /etc/tor/torrc
256
-        systemctl restart tor
256
+        systemctl reload tor
257 257
     fi
258 258
 
259 259
     # don't change resolv.conf