From 49995e61514e4d7dcb5b3d95c5307080ab47fe10 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 3 Aug 2019 11:52:41 +0200 Subject: [PATCH] add install script | add minimal readme --- README.md | 20 ++++++++++++++++++++ install.sh | 7 +++++++ 2 files changed, 27 insertions(+) create mode 100644 README.md create mode 100755 install.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..b7248e1 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +## Firewall integration in systemd + + + +Simple tool to load your **iptables** rules at boot time. It integrates with systemd as a multi instance service. + + + +##### 1/ Install the tool + +Launch the `./install.sh` script as root. + +##### 2/ Define your rules + +Place a bash script defining your **iptables** rules into `/opt/firewall/.fw` where `` is an arbitrary name that makes sense to you. + +##### 3/ Enable at boot + +To enable your rules to load at boot time, simply run `systemctl enable firewall@.service`. If you want to execute your script explicitly run `systemctl start firewall@.service`. + diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..69eb28f --- /dev/null +++ b/install.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +root=$(realpath $(dirname $0)); + +# 1/ copy the service file +mkdir -p /usr/lib/systemd/system/; +cp -r ./usr/lib/systemd/system/firewall@.service /usr/lib/systemd/system/;