diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index 72b96d14..402a3a67 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -331,7 +331,20 @@ function show_domains { height=$(tput lines) # shellcheck disable=SC2068 - dialog --backtitle $"Freedombone Control Panel" --title $"Domains" --menu $"Use Shift+cursors to select and copy onion addresses" $((height-4)) $((width-4)) $((height-4)) "${W[@]}" 3>&2 2>&1 1>&3 + selected=$(dialog --backtitle $"Freedombone Control Panel" --title $"Domains" --menu $"Use Shift+cursors to select and copy onion addresses" $((height-4)) $((width-4)) $((height-4)) "${W[@]}" 3>&2 2>&1 1>&3) + if [[ "$selected" != *'.onion'* ]]; then + return + fi + intermediate=$(echo "$selected" | awk -F '.' '{print $2}') + if [[ "$intermediate" == *'/'* ]]; then + onion_addr=$(echo "$intermediate" | awk -F ' ' '{print $3}').onion + else + onion_addr="$selected".onion + fi + clear + echo "$onion_addr" + echo -n "$onion_addr" | qrencode -t UTF8 + any_key } function show_users {