Add blocked domains to /etc/hosts

This commit is contained in:
Bob Mottram 2018-02-14 19:10:25 +00:00
parent 578af997ca
commit a0a3d9f9a5
2 changed files with 18 additions and 12 deletions

View File

@ -101,6 +101,9 @@ function create_pleroma_blocklist {
echo " users_query=\"\${users_query} nickname ilike '%\${blocked}%'\"" >> $blocking_script_file
echo ' objects_updated=1' >> $blocking_script_file
echo ' if [[ "$blocked" != *"@"* ]]; then' >> $blocking_script_file
echo ' if ! grep -q "$blocked" /etc/hosts; then' >> $blocking_script_file
echo ' echo "127.0.0.1 $blocked" >> /etc/hosts' >> $blocking_script_file
echo ' fi' >> $blocking_script_file
echo ' if [ $websub_server_subscriptions_updated ]; then' >> $blocking_script_file
echo ' websub_server_subscriptions_query="${websub_server_subscriptions_query} or"' >> $blocking_script_file
echo ' fi' >> $blocking_script_file

View File

@ -63,6 +63,7 @@ function install_i2p {
}
function remove_i2p {
service i2p stop
apt-get -yq remove i2p-router --purge
apt-get -yq remove i2p --purge
apt-get -yq remove i2p-keyring --purge
@ -89,6 +90,8 @@ function remove_i2p {
function i2p_enable_sam {
if [ ! -f /var/lib/i2p/i2p-config/clients.config ]; then
service i2p stop
apt-get -yq remove i2p --purge
apt-get -yq remove i2p-router --purge
if [ -d /var/lib/i2p ]; then