commit c6cc1a64713255b71d77777ca2ca4dae99e55303 parent 70e1b307088071f2248d498119d01ed3ded21c51 Author: Morel BĂ©renger <berengermorel76@gmail.com> Date: Sun, 13 Dec 2020 21:56:14 +0100 generic: new runit function: iptables handling Diffstat:
M | templates/generic/root/etc/runit/common | | | 21 | +++++++++++++++++++++ |
1 file changed, 21 insertions(+), 0 deletions(-)
diff --git a/templates/generic/root/etc/runit/common b/templates/generic/root/etc/runit/common @@ -23,6 +23,27 @@ make_dir() fi } +iptables() +{ + RULES_FILE="${1:?"RULES_FILE not provided"}" + case $0 in + "./finish") + ACTION=-A + ;; + "./run") + ACTION=-D + ;; + *) + echo "Should only be called by ./run or ./finish scripts" + exit + ;; + esac + while read $LINE + do + iptables $ACTION $LINE + done +} + set -e exec 2>&1