浏览代码

Don't list undetected apps

Bob Mottram 8 年前
父节点
当前提交
27368c9424
共有 1 个文件被更改,包括 21 次插入15 次删除
  1. 21
    15
      src/freedombone-controlpanel

+ 21
- 15
src/freedombone-controlpanel 查看文件

@@ -347,28 +347,34 @@ function show_domains {
347 347
                 else
348 348
                     if [[ ${app_name} == "mumble" ]]; then
349 349
                         app_name="VoIP"
350
-                    fi
351
-                    if [[ ${app_name} == "gnusocial" ]]; then
352
-                        app_name="GNU Social"
353
-                    fi
354
-                    if [[ ${app_name} == "searx" ]]; then
355
-                        app_name="Search engine"
350
+                    else
351
+                        if [[ ${app_name} == "gnusocial" ]]; then
352
+                            app_name="GNU Social"
353
+                        else
354
+                            if [[ ${app_name} == "searx" ]]; then
355
+                                app_name="Search engine"
356
+                            else
357
+                                app_name=''
358
+                            fi
359
+                        fi
356 360
                     fi
357 361
                 fi
358 362
             fi
359 363
         fi
360 364
 
361
-        if grep -q "${app_name} domain" $COMPLETION_FILE; then
362
-            icann_address=$(cat ${COMPLETION_FILE} | grep "${app_name} domain" | head -n 1 | awk -F ':' '{print $2}')
363
-        fi
365
+        if [ ${#app_name} -gt 0 ]; then
366
+            if grep -q "${app_name} domain" $COMPLETION_FILE; then
367
+                icann_address=$(cat ${COMPLETION_FILE} | grep "${app_name} domain" | head -n 1 | awk -F ':' '{print $2}')
368
+            fi
364 369
 
365
-        if grep -q "${app_name} onion domain" $COMPLETION_FILE; then
366
-            onion_address=$(cat ${COMPLETION_FILE} | grep "${app_name} onion domain" | head -n 1 | awk -F ':' '{print $2}')
367
-        fi
370
+            if grep -q "${app_name} onion domain" $COMPLETION_FILE; then
371
+                onion_address=$(cat ${COMPLETION_FILE} | grep "${app_name} onion domain" | head -n 1 | awk -F ':' '{print $2}')
372
+            fi
368 373
 
369
-        echo -n -e "$(pad_string ${app_name})"
370
-        echo -n -e "$(pad_string ${icann_address})"
371
-        echo "${onion_address}"
374
+            echo -n -e "$(pad_string "${app_name}")"
375
+            echo -n -e "$(pad_string "${icann_address}")"
376
+            echo "${onion_address}"
377
+        fi
372 378
     done
373 379
 
374 380
     if grep -q "RSS reader domain" $COMPLETION_FILE; then