Browse Source

Better detection of onion address

Bob Mottram 6 years ago
parent
commit
99cf8b4419
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      src/freedombone-controlpanel

+ 2
- 3
src/freedombone-controlpanel View File

@@ -358,9 +358,8 @@ function show_domains {
358 358
         return
359 359
     fi
360 360
     # There are two forms of addresses: "x / y.onion" and "x.onion"
361
-    intermediate=$(echo "$selected_addresses" | awk -F '.' '{print $2}')
362
-    if [[ "$intermediate" == *'//'* ]]; then
363
-        onion_addr=$(echo "$intermediate" | awk -F ' ' '{print $3}').onion
361
+    if [[ "$selected_addresses" == *'/'* ]]; then
362
+        onion_addr=$(echo "$selected_addresses" | awk -F '/' '{print $2}' | awk -F ' ' '{print $2}').onion
364 363
     else
365 364
         onion_addr="$selected_addresses".onion
366 365
     fi