Browse Source

Handle mobile onion address

Bob Mottram 8 years ago
parent
commit
1ae076f81b
2 changed files with 9 additions and 4 deletions
  1. 1
    1
      src/freedombone-controlpanel
  2. 8
    3
      src/freedombone-utils-onion

+ 1
- 1
src/freedombone-controlpanel View File

372
             echo "${onion_address}"
372
             echo "${onion_address}"
373
 
373
 
374
             if grep -q "${app_name}_mobile onion domain" $COMPLETION_FILE; then
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
                 echo -n -e "$(pad_string "${app_name} (mobile)")"
376
                 echo -n -e "$(pad_string "${app_name} (mobile)")"
377
                 echo -n -e "$(pad_string "${icann_address}")"
377
                 echo -n -e "$(pad_string "${icann_address}")"
378
                 echo "${onion_address}"
378
                 echo "${onion_address}"

+ 8
- 3
src/freedombone-utils-onion View File

382
 
382
 
383
 function get_app_onion_address {
383
 function get_app_onion_address {
384
     app_name="$1"
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
             return
393
             return
389
         fi
394
         fi
390
     fi
395
     fi