old-firewall/lib/loadrules.bash

36 lines
589 B
Bash
Raw Normal View History

2013-03-11 08:32:52 +00:00
# this file is not meant to be used as a standalone binary
loadrules() {
flag="-I"
append="-A"
2013-03-11 08:32:52 +00:00
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"
2013-03-11 08:32:52 +00:00
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
}