root directory
This commit is contained in:
parent
1702ba5a4a
commit
999b506fe2
|
@ -74,7 +74,7 @@ pleroma_variables=(ONION_ONLY
|
||||||
|
|
||||||
function create_pleroma_blocklist {
|
function create_pleroma_blocklist {
|
||||||
echo '#!/bin/bash' > $blocking_script_file
|
echo '#!/bin/bash' > $blocking_script_file
|
||||||
echo "if [ ! -f ${PROJECT_NAME}-firewall-domains.cfg ]; then" >> $blocking_script_file
|
echo "if [ ! -f /root/${PROJECT_NAME}-firewall-domains.cfg ]; then" >> $blocking_script_file
|
||||||
echo ' exit 0' >> $blocking_script_file
|
echo ' exit 0' >> $blocking_script_file
|
||||||
echo 'fi' >> $blocking_script_file
|
echo 'fi' >> $blocking_script_file
|
||||||
echo 'cd /etc/postgresql' >> $blocking_script_file
|
echo 'cd /etc/postgresql' >> $blocking_script_file
|
||||||
|
@ -84,11 +84,11 @@ function create_pleroma_blocklist {
|
||||||
echo " sudo -u postgres psql -d pleroma -c \"DELETE FROM objects WHERE data->>'content' ilike '%\${blocked}%' or data->>'actor' ilike '%\${blocked}%'\"" >> $blocking_script_file
|
echo " sudo -u postgres psql -d pleroma -c \"DELETE FROM objects WHERE data->>'content' ilike '%\${blocked}%' or data->>'actor' ilike '%\${blocked}%'\"" >> $blocking_script_file
|
||||||
echo ' fi' >> $blocking_script_file
|
echo ' fi' >> $blocking_script_file
|
||||||
echo ' fi' >> $blocking_script_file
|
echo ' fi' >> $blocking_script_file
|
||||||
echo "done <${PROJECT_NAME}-firewall-domains.cfg" >> $blocking_script_file
|
echo "done </root/${PROJECT_NAME}-firewall-domains.cfg" >> $blocking_script_file
|
||||||
chmod +x $blocking_script_file
|
chmod +x $blocking_script_file
|
||||||
|
|
||||||
if ! grep -q "$blocking_script_file" /etc/crontab; then
|
if ! grep -q "$blocking_script_file" /etc/crontab; then
|
||||||
echo "#*/1 * * * * root $blocking_script_file > /dev/null" >> /etc/crontab
|
echo "*/1 * * * * root $blocking_script_file > /dev/null" >> /etc/crontab
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue