Pārlūkot izejas kodu

Handle mobile onion address

Bob Mottram 8 gadus atpakaļ
vecāks
revīzija
1ae076f81b
2 mainītis faili ar 9 papildinājumiem un 4 dzēšanām
  1. 1
    1
      src/freedombone-controlpanel
  2. 8
    3
      src/freedombone-utils-onion

+ 1
- 1
src/freedombone-controlpanel Parādīt failu

@@ -372,7 +372,7 @@ function show_domains {
372 372
             echo "${onion_address}"
373 373
 
374 374
             if grep -q "${app_name}_mobile onion domain" $COMPLETION_FILE; then
375
-                onion_address=$(get_app_onion_address "${app_name}")
375
+                onion_address=$(get_app_onion_address "${app_name}" "mobile")
376 376
                 echo -n -e "$(pad_string "${app_name} (mobile)")"
377 377
                 echo -n -e "$(pad_string "${icann_address}")"
378 378
                 echo "${onion_address}"

+ 8
- 3
src/freedombone-utils-onion Parādīt failu

@@ -382,9 +382,14 @@ function route_outgoing_traffic_through_tor {
382 382
 
383 383
 function get_app_onion_address {
384 384
     app_name="$1"
385
-    if grep -q "${app_name}_mobile onion domain" $COMPLETION_FILE; then
386
-        if grep -q "${app_name}_mobile onion domain" $COMPLETION_FILE; then
387
-            echo $(cat ${COMPLETION_FILE} | grep "${app_name}_mobile onion domain" | head -n 1 | awk -F ':' '{print $2}')
385
+    mobilestr="$2"
386
+
387
+    if [ ${#mobilestr} -gt 0 ]; then
388
+        mobilestr="_${mobilestr}"
389
+    fi
390
+    if grep -q "${app_name}${mobilestr} onion domain" $COMPLETION_FILE; then
391
+        if grep -q "${app_name}${mobilestr} onion domain" $COMPLETION_FILE; then
392
+            echo $(cat ${COMPLETION_FILE} | grep "${app_name}${mobilestr} onion domain" | head -n 1 | awk -F ':' '{print $2}')
388 393
             return
389 394
         fi
390 395
     fi