]> git.somenet.org - ctf/pub/network.git/blob - xtable_git_load.sh
xtables snapshot/load/apply-new scripts - needed for sucessful boot!
[ctf/pub/network.git] / xtable_git_load.sh
1 #!/bin/bash
2 #
3 # Copyright 2013-2016 by Jan Vales <jan@jvales.net> (Someone <someone@somenet.org>)
4 # send me your changes. credit author(s). do not publish. share alike.
5 # to be done: find a suitable licence text.
6 #
7 # Script to reload CURRENT xtable rules from gitrepo.
8 # Most likely no longer really useful as of 2016.
9 #
10
11 cd /root/network
12 chmod -R u=rw,go-rwx .
13 chmod u+x *.sh
14
15 if [[ ! -d "xtable_rules/.git" ]]; then
16   echo "*** ERROR: cannot cd xtable_current_rules or git repo not found."
17   exit 1
18 fi
19
20 cd xtable_rules
21
22 /sbin/iptables-restore < iptable.rules.current.save
23