diff --git a/src/freedombone-logging b/src/freedombone-logging index 80d8b5ba..3e87fe28 100755 --- a/src/freedombone-logging +++ b/src/freedombone-logging @@ -158,8 +158,7 @@ if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then touch /var/log/tor/notices.log chown debian-tor:adm /var/log/tor/notices.log fi - sed -i 's|#Log notice file.*|Log notice file /var/log/tor/notices.log|g' /etc/tor/torrc - sed -i 's|Log notice file.*|Log notice file /var/log/tor/notices.log|g' /etc/tor/torrc + echo 'Log notice file /var/log/tor/notices.log' > /etc/torrc.d/logging fi if [ -f /etc/php/7.0/fpm/php-fpm.conf ]; then sed -i 's|error_log =.*|error_log = /var/log/php-fpm.log|g' /etc/php/7.0/fpm/php-fpm.conf @@ -206,8 +205,7 @@ else turn_logging_off if [ -d /etc/tor ]; then - 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 + echo 'Log notice file /dev/null' > /etc/torrc.d/logging rm /var/log/tor/* fi if [ -d /var/log/radicale ]; then diff --git a/src/freedombone-utils-onion b/src/freedombone-utils-onion index 80d886d7..c75851be 100755 --- a/src/freedombone-utils-onion +++ b/src/freedombone-utils-onion @@ -323,14 +323,6 @@ function install_tor { # For torify apt-get -yq install torsocks - # turn off logging - 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_MONTH_GB GBytes|g" /etc/tor/torrc - sed -i "s|AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_MONTH_GB GBytes|g" /etc/tor/torrc - if [ ! -d /etc/torrc.d ]; then mkdir /etc/torrc.d fi @@ -339,6 +331,9 @@ function install_tor { echo '%include /etc/torrc.d' >> /etc/tor/torrc fi + echo 'Log notice file /dev/null' > /etc/torrc.d/logging + echo "AccountingMax $TOR_MAX_TRAFFIC_PER_MONTH_GB GBytes" > /etc/torrc.d/maxtraffic + mark_completed "${FUNCNAME[0]}" }