Commit eef4d5fd authored by Thomas Capricelli's avatar Thomas Capricelli
Browse files

until we have a way to propagate the information "this ip/host has been

removed from black list", let's flush/fill again all lists.
parent 39baa435adf6
......@@ -72,6 +72,16 @@ def restart_daemons(c):
c.run("supervisorctl restart botfreak-watcher", pty=False )
print("Finished at" + datetime.datetime.now().strftime("%Y-%m-%d %H:%M"))
@task(hosts=daemons_hosts)
def clear_daemons(c):
"Empty ipset lists"
c.run("echo ' '")
c.run("uname -a")
c.run("ipset flush botfreak-ipv4", pty=False )
c.run("ipset flush botfreak-ipv6", pty=False )
print("Finished at" + datetime.datetime.now().strftime("%Y-%m-%d %H:%M"))
@task(hosts=web_hosts)
def deploy_web(c):
"Update and restart the web server"
......@@ -86,6 +96,13 @@ def deploy_daemons(c):
restart_daemons(c)
print("Finished at" + datetime.datetime.now().strftime("%Y-%m-%d %H:%M"))
@task(hosts=daemons_hosts)
def reinit_daemons(c):
"Clear all ipsets lists and restart the daemon to fill them cleanly"
clear_daemons(c)
restart_daemons(c)
print("Finished at" + datetime.datetime.now().strftime("%Y-%m-%d %H:%M"))
@task()
def deploy(c):
"Deploy new code"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment