much cleanup

This commit is contained in:
Lee
2024-01-15 22:59:08 +00:00
parent 23852729c1
commit 7b83facc21
8 changed files with 247 additions and 155 deletions

View File

@ -0,0 +1,29 @@
from colorama import Fore
from command.command import Command
from traefik.traefikConfig import TraefikConfig
from utils.dockerUtils import restartTraefik
class RemoveCommand(Command):
def __init__(self):
super().__init__("remove", "Remove a domain", "remove <name>")
def execute(self, traefikConfig:TraefikConfig, args):
if len(args) < 0:
self.printUsage()
return
name = args[0]
if not traefikConfig.hasRouter(name):
print(f"Router \"{name}\" does not exist")
return
print(f"Removing \"{name}\"")
traefikConfig.removeRouter(name)
traefikConfig.save()
restartTraefik()
print(f"Removed \"{name}\"")