Added file software.txt and updated README.md
This commit is contained in:
pare
f496fb46bf
commit
da31623616
S'han modificat 2 arxius amb 17 adicions i 6 eliminacions
|
@ -14,7 +14,9 @@ Within Python Virtual Environment:
|
|||
|
||||
1. Run `pip install -r requirements.txt` to install needed Python libraries.
|
||||
|
||||
3. Run `python peers.py` to collect and store all needed data from your server peers..
|
||||
2. Run `python peers.py` to collect and store all needed data from your server peers.
|
||||
|
||||
3. Edit `software.txt` file, add the software you want to block, one per line, and save it.
|
||||
|
||||
4. Run `python blocksoft.py` to block the configured software..
|
||||
|
||||
|
|
19
blocksoft.py
19
blocksoft.py
|
@ -8,7 +8,6 @@ from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
|
|||
import getpass
|
||||
import fileinput,re
|
||||
import requests
|
||||
import pdb
|
||||
|
||||
class DomainBlocks():
|
||||
|
||||
|
@ -481,13 +480,23 @@ if __name__ == '__main__':
|
|||
|
||||
blocker = DomainBlocks()
|
||||
|
||||
software = 'birdsitelive'
|
||||
soft_list = 'software.txt'
|
||||
|
||||
servers_list = blocker.get_servers(software)
|
||||
soft_file = open(soft_list, 'r')
|
||||
|
||||
for server in servers_list:
|
||||
Lines = soft_file.readlines()
|
||||
|
||||
blocker.domain_blocks_create(server)
|
||||
for software in Lines:
|
||||
|
||||
software = software.replace('\n', '')
|
||||
|
||||
print(f'checking software {software}...')
|
||||
|
||||
servers_list = blocker.get_servers(software)
|
||||
|
||||
for server in servers_list:
|
||||
|
||||
blocker.domain_blocks_create(server)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Referencia en una nova incidència