2020-08-01 00:32:41 +02:00
|
|
|
import subprocess
|
|
|
|
from shutil import copyfile
|
|
|
|
|
|
|
|
|
|
|
|
def run():
|
|
|
|
subprocess.call("apt install fail2ban -y", shell=True)
|
|
|
|
|
|
|
|
try:
|
|
|
|
ufw_is_installed = subprocess.check_output("which ufw", shell=True).decode().strip()
|
|
|
|
print(f"ufw is already installed in {ufw_is_installed}")
|
|
|
|
except subprocess.CalledProcessError:
|
|
|
|
subprocess.call("sudo apt install ufw -y", shell=True)
|
|
|
|
subprocess.call("ufw allow ssh && ufw enable", shell=True)
|
|
|
|
|
|
|
|
copyfile("./modules/fail2ban/jail.local", "/etc/fail2ban/jail.local")
|
2020-08-02 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
functions = {
|
|
|
|
"run": run
|
|
|
|
}
|