Handle mobile onion address

This commit is contained in:
Bob Mottram 2016-11-21 10:29:29 +00:00
parent 361742f564
commit 1ae076f81b
2 changed files with 9 additions and 4 deletions

View File

@ -372,7 +372,7 @@ function show_domains {
echo "${onion_address}" echo "${onion_address}"
if grep -q "${app_name}_mobile onion domain" $COMPLETION_FILE; then if grep -q "${app_name}_mobile onion domain" $COMPLETION_FILE; then
onion_address=$(get_app_onion_address "${app_name}") onion_address=$(get_app_onion_address "${app_name}" "mobile")
echo -n -e "$(pad_string "${app_name} (mobile)")" echo -n -e "$(pad_string "${app_name} (mobile)")"
echo -n -e "$(pad_string "${icann_address}")" echo -n -e "$(pad_string "${icann_address}")"
echo "${onion_address}" echo "${onion_address}"

View File

@ -382,9 +382,14 @@ function route_outgoing_traffic_through_tor {
function get_app_onion_address { function get_app_onion_address {
app_name="$1" app_name="$1"
if grep -q "${app_name}_mobile onion domain" $COMPLETION_FILE; then mobilestr="$2"
if grep -q "${app_name}_mobile onion domain" $COMPLETION_FILE; then
echo $(cat ${COMPLETION_FILE} | grep "${app_name}_mobile onion domain" | head -n 1 | awk -F ':' '{print $2}') if [ ${#mobilestr} -gt 0 ]; then
mobilestr="_${mobilestr}"
fi
if grep -q "${app_name}${mobilestr} onion domain" $COMPLETION_FILE; then
if grep -q "${app_name}${mobilestr} onion domain" $COMPLETION_FILE; then
echo $(cat ${COMPLETION_FILE} | grep "${app_name}${mobilestr} onion domain" | head -n 1 | awk -F ':' '{print $2}')
return return
fi fi
fi fi