Restrict tor traffic

This commit is contained in:
Bob Mottram 2017-06-03 19:10:04 +01:00
parent 5e76d9bc68
commit 109d6bf848
1 changed files with 7 additions and 0 deletions

View File

@ -28,6 +28,9 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The maximum amount of traffic per day in gigabytes
TOR_MAX_TRAFFIC_PER_DAY_GB=3
function add_email_hostname {
extra_email_hostname="$1"
email_hostnames=$(cat /etc/exim4/update-exim4.conf.conf | grep "dc_other_hostnames" | awk -F "'" '{print $2}')
@ -287,6 +290,10 @@ function install_tor {
sed -i 's|#Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
sed -i 's|Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
# Restrict traffic
sed -i "s|#AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_DAY_GB GBytes|g" /etc/tor/torrc
sed -i "s|AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_DAY_GB GBytes|g" /etc/tor/torrc
mark_completed $FUNCNAME
}