blob: 4b9d78e8aafd017de371017d9cdc61c16112febf (
plain) (
tree)
|
|
#!/bin/sh
#
# IPFire Custom Rules (icr)
#
# Github: https://github.com/MonkeyCat/IPFireCustomRules
#
# Loops over the local "rules.d/" subfolder files
# Forwarding the (start/stop) command to every file
# which extension is ".on". To enabled multiple
# custom firewall rulesets!
#
# the configuration of the ipfire custom rules (ipfcr)
# in the local "rules.d/*" sunfolder, is inside the
# files themself!
#
# Use this at your OWN RISK. Not fully supported!
#
# License: GPL2
#
# icr v0.1 (c) 30 May 2022 code.monkeycat.com
#
# Nuff text...
pwd=$PWD
base=${PWD%/*/*}
case "$1" in
start)
find $base/rules.d/ -maxdepth 1 -type f \( ! -name . \) -exec bash -c "{} $1" \;
;;
stop)
find $base/rules.d/ -maxdepth 1 -type f \( ! -name . \) -exec bash -c "{} $1" \;
;;
reload)
$0 stop
$0 start
;;
flush)
iptables -t nat -F CUSTOMPREROUTING
iptables -t nat -F CUSTOMPOSTROUTING
iptables -F CUSTOMFORWARD
;;
*)
echo "Usage: $0 {start|stop|reload|flush}"
;;
esac
|