forked from ungleich-public/cdist
Removed ${rcvar} but never renamed ${rcvar}.new
Was trying to load ${rcvar} into pf, but couldn't because new ruleset was never renamed.
This commit is contained in:
parent
613305e923
commit
629f751726
1 changed files with 3 additions and 2 deletions
|
@ -39,13 +39,14 @@ if [ -f "${rcvar}.old" ]; then # rcvar.old exists, we must need to disable pf
|
||||||
elif [ -f "${rcvar}.new" ]; then # rcvar.new exists, we must need to apply it
|
elif [ -f "${rcvar}.new" ]; then # rcvar.new exists, we must need to apply it
|
||||||
# Ensure that pf is enabled in the first place
|
# Ensure that pf is enabled in the first place
|
||||||
# If it already is enabled, pfctl -e returns 1, go on with life
|
# If it already is enabled, pfctl -e returns 1, go on with life
|
||||||
|
[ -f "${rcvar}" ] && rm -f "${rcvar}"
|
||||||
|
mv "${rcvar}.new" "${rcvar}"
|
||||||
pfctl -e || true
|
pfctl -e || true
|
||||||
pfctl -f "${rcvar}"
|
pfctl -f "${rcvar}"
|
||||||
ret="$?"
|
ret="$?"
|
||||||
# Cleanup
|
# Cleanup
|
||||||
|
# This file shouldn't exist, but just in case
|
||||||
rm -f "${rcvar}.old"
|
rm -f "${rcvar}.old"
|
||||||
# This file shouldn't exist, but just in case...
|
|
||||||
[ -f "${rcvar}" ] && rm -f "${rcvar}"
|
|
||||||
if [ "$ret" -ne "0" ]; then # failed to configure new ruleset
|
if [ "$ret" -ne "0" ]; then # failed to configure new ruleset
|
||||||
echo "Failed to configure the new ruleset on ${__target_host}!" >&2
|
echo "Failed to configure the new ruleset on ${__target_host}!" >&2
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue