Better detection of onion address

This commit is contained in:
Bob Mottram 2018-05-08 13:56:52 +01:00
parent 1cce575ccd
commit 99cf8b4419
1 changed files with 2 additions and 3 deletions

View File

@ -358,9 +358,8 @@ function show_domains {
return return
fi fi
# There are two forms of addresses: "x / y.onion" and "x.onion" # There are two forms of addresses: "x / y.onion" and "x.onion"
intermediate=$(echo "$selected_addresses" | awk -F '.' '{print $2}') if [[ "$selected_addresses" == *'/'* ]]; then
if [[ "$intermediate" == *'//'* ]]; then onion_addr=$(echo "$selected_addresses" | awk -F '/' '{print $2}' | awk -F ' ' '{print $2}').onion
onion_addr=$(echo "$intermediate" | awk -F ' ' '{print $3}').onion
else else
onion_addr="$selected_addresses".onion onion_addr="$selected_addresses".onion
fi fi