From abbd9a82e86ad6951207baf733802886be3fff9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Loif=C3=BChrer?= <michael.loipfuehrer@tum.de> Date: Fri, 7 Jun 2019 20:48:49 +0200 Subject: [PATCH] small change --- lustmolch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lustmolch.py b/lustmolch.py index c059e57..538970a 100755 --- a/lustmolch.py +++ b/lustmolch.py @@ -22,6 +22,7 @@ template_files_container = [ FLAVOUR = 'buster' DEBIAN_MIRROR = 'http://mirror.stusta.de/debian' +IP_RANGES = ['10.150.0.0/17', '141.84.69.0/24'] www_root = Path('/var/www') SSH_START_PORT = 10022 @@ -130,8 +131,7 @@ def create_container(dry_run, config_file, name): click.echo(f'Updating Iptable rules for port {context["ssh_port"]}') if not dry_run: - ip_ranges = ['10.150.0.0/17', '141.84.69.0/24'] - for ip_range in ip_ranges: + for ip_range in IP_RANGES: run(['iptables', '-A', 'INPUT', '-p', 'tcp', '-m', 'tcp', '--dport', context['ssh_port'], '-s', ip_range, '-j', 'ACCEPT']) click.echo('Starting container') @@ -208,6 +208,8 @@ def remove_container(config_file, name): except OSError as e: click.echo(f'{e} ignored when updating config file') + click.echo('All done, although you might need to manually remove some iptable rules.') + if __name__ == '__main__': cli() -- GitLab