Show QR code for selected about screen entries on control panel

This commit is contained in:
Bob Mottram 2018-05-08 13:29:38 +01:00
parent 7806870ca9
commit f2c9325b9b
1 changed files with 14 additions and 1 deletions

View File

@ -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 {