Bläddra i källkod

Restrict tor traffic

Bob Mottram 8 år sedan
förälder
incheckning
109d6bf848
1 ändrade filer med 7 tillägg och 0 borttagningar
  1. 7
    0
      src/freedombone-utils-onion

+ 7
- 0
src/freedombone-utils-onion Visa fil

28
 # You should have received a copy of the GNU Affero General Public License
28
 # You should have received a copy of the GNU Affero General Public License
29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
30
 
30
 
31
+# The maximum amount of traffic per day in gigabytes
32
+TOR_MAX_TRAFFIC_PER_DAY_GB=3
33
+
31
 function add_email_hostname {
34
 function add_email_hostname {
32
     extra_email_hostname="$1"
35
     extra_email_hostname="$1"
33
     email_hostnames=$(cat /etc/exim4/update-exim4.conf.conf | grep "dc_other_hostnames" | awk -F "'" '{print $2}')
36
     email_hostnames=$(cat /etc/exim4/update-exim4.conf.conf | grep "dc_other_hostnames" | awk -F "'" '{print $2}')
287
     sed -i 's|#Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
290
     sed -i 's|#Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
288
     sed -i 's|Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
291
     sed -i 's|Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
289
 
292
 
293
+    # Restrict traffic
294
+    sed -i "s|#AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_DAY_GB GBytes|g" /etc/tor/torrc
295
+    sed -i "s|AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_DAY_GB GBytes|g" /etc/tor/torrc
296
+
290
     mark_completed $FUNCNAME
297
     mark_completed $FUNCNAME
291
 }
298
 }
292
 
299