浏览代码

Don't restart tor if not needed

Bob Mottram 9 年前
父节点
当前提交
698cba0449
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6
    0
      src/freedombone

+ 6
- 0
src/freedombone 查看文件

@@ -1294,6 +1294,12 @@ function add_onion_service {
1294 1294
     onion_service_name="$1"
1295 1295
     onion_service_port_from=$2
1296 1296
     onion_service_port_to=$3
1297
+
1298
+    if [ -f /var/lib/tor/hidden_service_${onion_service_name}/hostname ]; then
1299
+        echo $(cat /var/lib/tor/hidden_service_${onion_service_name}/hostname)
1300
+        return
1301
+    fi
1302
+
1297 1303
     if [ ! -d /var/lib/tor ]; then
1298 1304
         echo $"No Tor installation found. ${onion_service_name} onion site cannot be configured."
1299 1305
         exit 877367