From 27368c9424130f354d612a8ccc839ac30c915d8c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 1 Oct 2016 14:31:18 +0100 Subject: [PATCH] Don't list undetected apps --- src/freedombone-controlpanel | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index 3735feb6..e6f1ebb9 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -347,28 +347,34 @@ function show_domains { else if [[ ${app_name} == "mumble" ]]; then app_name="VoIP" - fi - if [[ ${app_name} == "gnusocial" ]]; then - app_name="GNU Social" - fi - if [[ ${app_name} == "searx" ]]; then - app_name="Search engine" + else + if [[ ${app_name} == "gnusocial" ]]; then + app_name="GNU Social" + else + if [[ ${app_name} == "searx" ]]; then + app_name="Search engine" + else + app_name='' + fi + fi fi fi fi fi - if grep -q "${app_name} domain" $COMPLETION_FILE; then - icann_address=$(cat ${COMPLETION_FILE} | grep "${app_name} domain" | head -n 1 | awk -F ':' '{print $2}') - fi + if [ ${#app_name} -gt 0 ]; then + if grep -q "${app_name} domain" $COMPLETION_FILE; then + icann_address=$(cat ${COMPLETION_FILE} | grep "${app_name} domain" | head -n 1 | awk -F ':' '{print $2}') + fi - if grep -q "${app_name} onion domain" $COMPLETION_FILE; then - onion_address=$(cat ${COMPLETION_FILE} | grep "${app_name} onion domain" | head -n 1 | awk -F ':' '{print $2}') - fi + if grep -q "${app_name} onion domain" $COMPLETION_FILE; then + onion_address=$(cat ${COMPLETION_FILE} | grep "${app_name} onion domain" | head -n 1 | awk -F ':' '{print $2}') + fi - echo -n -e "$(pad_string ${app_name})" - echo -n -e "$(pad_string ${icann_address})" - echo "${onion_address}" + echo -n -e "$(pad_string "${app_name}")" + echo -n -e "$(pad_string "${icann_address}")" + echo "${onion_address}" + fi done if grep -q "RSS reader domain" $COMPLETION_FILE; then