Don't remove tor log

It causes tor to fail
This commit is contained in:
Bob Mottram 2017-06-18 15:04:52 +01:00
parent e5db89ecb6
commit 7c32e02d47
3 changed files with 11 additions and 11 deletions

View File

@ -580,6 +580,8 @@ function install_gnusocial_main {
function_check add_ddns_domain
add_ddns_domain $GNUSOCIAL_DOMAIN_NAME
GNUSOCIAL_ONION_HOSTNAME=$(add_onion_service gnusocial 80 ${GNUSOCIAL_ONION_PORT})
gnusocial_nginx_site=/etc/nginx/sites-available/$GNUSOCIAL_DOMAIN_NAME
if [[ $ONION_ONLY == "no" ]]; then
function_check nginx_http_redirect
@ -641,7 +643,7 @@ function install_gnusocial_main {
fi
echo 'server {' >> $gnusocial_nginx_site
echo " listen 127.0.0.1:$GNUSOCIAL_ONION_PORT default_server;" >> $gnusocial_nginx_site
echo " server_name $GNUSOCIAL_DOMAIN_NAME;" >> $gnusocial_nginx_site
echo " server_name $GNUSOCIAL_ONION_HOSTNAME;" >> $gnusocial_nginx_site
echo '' >> $gnusocial_nginx_site
function_check nginx_compress
nginx_compress $GNUSOCIAL_DOMAIN_NAME
@ -710,8 +712,6 @@ function install_gnusocial_main {
gnusocial_ssl='never'
fi
GNUSOCIAL_ONION_HOSTNAME=$(add_onion_service gnusocial 80 ${GNUSOCIAL_ONION_PORT})
GNUSOCIAL_SERVER=${GNUSOCIAL_DOMAIN_NAME}
if [[ $ONION_ONLY != 'no' ]]; then
GNUSOCIAL_SERVER=${GNUSOCIAL_ONION_HOSTNAME}

View File

@ -591,6 +591,8 @@ function install_postactiv_main {
function_check add_ddns_domain
add_ddns_domain $POSTACTIV_DOMAIN_NAME
POSTACTIV_ONION_HOSTNAME=$(add_onion_service postactiv 80 ${POSTACTIV_ONION_PORT})
postactiv_nginx_site=/etc/nginx/sites-available/$POSTACTIV_DOMAIN_NAME
if [[ $ONION_ONLY == "no" ]]; then
function_check nginx_http_redirect
@ -652,7 +654,7 @@ function install_postactiv_main {
fi
echo 'server {' >> $postactiv_nginx_site
echo " listen 127.0.0.1:$POSTACTIV_ONION_PORT default_server;" >> $postactiv_nginx_site
echo " server_name $POSTACTIV_DOMAIN_NAME;" >> $postactiv_nginx_site
echo " server_name $POSTACTIV_ONION_HOSTNAME;" >> $postactiv_nginx_site
echo '' >> $postactiv_nginx_site
function_check nginx_disable_sniffing
nginx_disable_sniffing $POSTACTIV_DOMAIN_NAME
@ -721,8 +723,6 @@ function install_postactiv_main {
postactiv_ssl='never'
fi
POSTACTIV_ONION_HOSTNAME=$(add_onion_service postactiv 80 ${POSTACTIV_ONION_PORT})
POSTACTIV_SERVER=${POSTACTIV_DOMAIN_NAME}
if [[ $ONION_ONLY != 'no' ]]; then
POSTACTIV_SERVER=${POSTACTIV_ONION_HOSTNAME}

View File

@ -94,9 +94,13 @@ if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then
sed -i 's|logtarget.*|logtarget = /var/log/fail2ban.log|g' /etc/fail2ban/fail2ban.conf
fi
if [ -d /etc/tor ]; then
if [ ! -d /var/log/tor ]; then
mkdir /var/log/tor
chown -R debian-tor:adm /var/log/tor
fi
if [ ! -f /var/log/tor/notices.log ]; then
touch /var/log/tor/notices.log
chown debian-tor:debian-tor /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
@ -169,10 +173,6 @@ else
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
if [ -d /var/log/tor ]; then
$REMOVE_FILES_COMMAND /var/log/tor/*
rm -rf /var/log/tor
fi
fi
if [ -f /etc/mumble-server.ini ]; then
sed -i 's|logfile=.*|logfile=/dev/null|g' /etc/mumble-server.ini