|  | @@ -342,37 +342,6 @@ function install_tor {
 | 
	
		
			
			| 342 | 342 |      mark_completed "${FUNCNAME[0]}"
 | 
	
		
			
			| 343 | 343 |  }
 | 
	
		
			
			| 344 | 344 |  
 | 
	
		
			
			| 345 |  | -function resolve_dns_via_tor {
 | 
	
		
			
			| 346 |  | -    if [[ $SYSTEM_TYPE == "mesh"* ]]; then
 | 
	
		
			
			| 347 |  | -        return
 | 
	
		
			
			| 348 |  | -    fi
 | 
	
		
			
			| 349 |  | -    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
 | 
	
		
			
			| 350 |  | -        return
 | 
	
		
			
			| 351 |  | -    fi
 | 
	
		
			
			| 352 |  | -    if [ ! -f /etc/tor/torrc ]; then
 | 
	
		
			
			| 353 |  | -        echo $'tor was not installed'
 | 
	
		
			
			| 354 |  | -        exit 52952
 | 
	
		
			
			| 355 |  | -    fi
 | 
	
		
			
			| 356 |  | -
 | 
	
		
			
			| 357 |  | -    # resolve DNS via tor
 | 
	
		
			
			| 358 |  | -    if ! grep -q 'DNSPort 53' /etc/tor/torrc; then
 | 
	
		
			
			| 359 |  | -        { echo 'DNSPort 53';
 | 
	
		
			
			| 360 |  | -          echo 'AutomapHostsOnResolve 1';
 | 
	
		
			
			| 361 |  | -          echo 'AutomapHostsSuffixes .exit,.onion'; } >> /etc/tor/torrc
 | 
	
		
			
			| 362 |  | -        onion_update
 | 
	
		
			
			| 363 |  | -    fi
 | 
	
		
			
			| 364 |  | -
 | 
	
		
			
			| 365 |  | -    # don't change resolv.conf
 | 
	
		
			
			| 366 |  | -    sed -i 's|, domain-name-servers||g' /etc/dhcp/dhclient.conf
 | 
	
		
			
			| 367 |  | -
 | 
	
		
			
			| 368 |  | -    # point resolv.conf to tor
 | 
	
		
			
			| 369 |  | -    resolvconf=/etc/resolvconf/resolv.conf.d/head
 | 
	
		
			
			| 370 |  | -    echo 'nameserver 127.0.0.1:53' > $resolvconf
 | 
	
		
			
			| 371 |  | -    resolvconf -u
 | 
	
		
			
			| 372 |  | -
 | 
	
		
			
			| 373 |  | -    mark_completed "${FUNCNAME[0]}"
 | 
	
		
			
			| 374 |  | -}
 | 
	
		
			
			| 375 |  | -
 | 
	
		
			
			| 376 | 345 |  # see https://trac.torproject.org/projects/tor/wiki/doc/TransparentProxy
 | 
	
		
			
			| 377 | 346 |  # Local Redirection and Anonymizing Middlebox
 | 
	
		
			
			| 378 | 347 |  function route_outgoing_traffic_through_tor {
 |