From 6a9a0ad314cddf204f8402e7516e1abab4a11ca9 Mon Sep 17 00:00:00 2001 From: David Garcia Date: Tue, 26 May 2020 19:27:03 +0200 Subject: [PATCH] Install iptables-persistent if it doesn't exist Change-Id: I7535e7ff3b74236cd3c7e752244252481582d557 Signed-off-by: David Garcia --- n2vc/provisioner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/n2vc/provisioner.py b/n2vc/provisioner.py index b170b2e..fbb16ca 100644 --- a/n2vc/provisioner.py +++ b/n2vc/provisioner.py @@ -72,8 +72,8 @@ fi IPTABLES_SCRIPT = """#!/bin/bash set -e -apt-get update -DEBIAN_FRONTEND=noninteractive apt-get install -yqq iptables-persistent +[ -v `which netfilter-persistent` ] && apt update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -yqq iptables-persistent iptables -t nat -A OUTPUT -p tcp -d {} -j DNAT --to-destination {} netfilter-persistent save """ -- 2.25.1