Move dns settings to separate tor config file
This commit is contained in:
parent
62b5592b58
commit
5e80ab9df4
|
@ -320,26 +320,9 @@ function configure_email_onion {
|
|||
echo " hosts_avoid_tls = *";
|
||||
echo " socks_proxy = 127.0.0.1 port=9050"; } > /etc/exim4/conf.d/transport/050_exim4-config_onion_relay
|
||||
|
||||
if ! grep -q "AutomapHostsOnResolve" /etc/tor/torrc; then
|
||||
echo 'AutomapHostsOnResolve 1' >> /etc/tor/torrc
|
||||
else
|
||||
sed -i 's|#AutomapHostsOnResolve.*|AutomapHostsOnResolve 1|g' /etc/tor/torrc
|
||||
sed -i 's|AutomapHostsOnResolve.*|AutomapHostsOnResolve 1|g' /etc/tor/torrc
|
||||
fi
|
||||
|
||||
if ! grep -q "DNSPort " /etc/tor/torrc; then
|
||||
echo 'DNSPort 5300' >> /etc/tor/torrc
|
||||
else
|
||||
sed -i 's|#DNSPort .*|DNSPort 5300|g' /etc/tor/torrc
|
||||
sed -i 's|DNSPort .*|DNSPort 5300|g' /etc/tor/torrc
|
||||
fi
|
||||
|
||||
if ! grep -q "DNSListenAddress" /etc/tor/torrc; then
|
||||
echo 'DNSListenAddress 127.0.0.1' >> /etc/tor/torrc
|
||||
else
|
||||
sed -i 's|#DNSListenAddress.*|DNSListenAddress 127.0.0.1|g' /etc/tor/torrc
|
||||
sed -i 's|DNSListenAddress.*|DNSListenAddress 127.0.0.1|g' /etc/tor/torrc
|
||||
fi
|
||||
{ echo 'DNSPort 5300';
|
||||
echo 'DNSListenAddress 127.0.0.1';
|
||||
echo 'AutomapHostsOnResolve 1'; } > /etc/torrc.d/dns
|
||||
|
||||
update-exim4.conf.template -r
|
||||
update-exim4.conf
|
||||
|
|
|
@ -53,6 +53,14 @@ function torrc_migrate {
|
|||
echo "%include /etc/torrc.d" >> /etc/tor/torrc
|
||||
fi
|
||||
|
||||
{ echo 'DNSPort 5300';
|
||||
echo 'DNSListenAddress 127.0.0.1';
|
||||
echo 'AutomapHostsOnResolve 1'; } > /etc/torrc.d/dns
|
||||
|
||||
sed -i '/DNSPort 5300/d' /etc/tor/torrc
|
||||
sed -i '/DNSListenAddress 127.0.0./d' /etc/tor/torrc
|
||||
sed -i '/AutomapHostsOnResolve 1/d' /etc/tor/torrc
|
||||
|
||||
systemctl restart tor
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue