old-firewall/lib/loadrules.bash

36 lines
589 B
Bash

# this file is not meant to be used as a standalone binary
loadrules() {
flag="-I"
append="-A"
if [[ ! $# -eq 1 ]]; then
echo "only one argument - filename expected"
exit 1
fi
if [[ ! -e "${1}" ]]; then
echo "file ${1} does not exist"
exit 1
fi
. "${1}"
rules
}
unloadrules() {
flag="-D"
append="-D"
if [[ ! $# -eq 1 ]]; then
echo "only one argument - filename expected"
exit 1
fi
if [[ ! -e "${1}" ]]; then
echo "file ${1} does not exist"
exit 1
fi
rules
}