diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index 533656f3..cde2a93c 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -110,11 +110,11 @@ function any_key { function get_app_icann_address { app_name="$1" - icann_address="" 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}') + echo $(cat ${COMPLETION_FILE} | grep "${app_name} domain" | head -n 1 | awk -F ':' '{print $2}') + return fi - echo "$icann_address" + echo "${DEFAULT_DOMAIN_NAME}" } function passwords_select_user { @@ -347,9 +347,6 @@ function show_domains { continue fi - icann_address=${DEFAULT_DOMAIN_NAME} - onion_address="-" - # handle the foibles of capitalisation if ! grep -q "${app_name} domain" $COMPLETION_FILE; then app_name_upper=$(echo ${app_name} | awk '{print toupper($0)}') @@ -366,6 +363,9 @@ function show_domains { if [ ${#app_name} -gt 0 ]; then icann_address=$(get_app_icann_address "$app_name") onion_address=$(get_app_onion_address "$app_name") + if [ ${#onion_address} -eq 0 ]; then + onion_address="-" + fi echo -n -e "$(pad_string "${app_name}")" echo -n -e "$(pad_string "${icann_address}")"