From 629f751726e61ff77ef8ec344e66031c37c0bc50 Mon Sep 17 00:00:00 2001 From: Jake Guffey Date: Wed, 19 Sep 2012 17:04:03 -0400 Subject: [PATCH] Removed ${rcvar} but never renamed ${rcvar}.new Was trying to load ${rcvar} into pf, but couldn't because new ruleset was never renamed. --- conf/type/__pf_apply/gencode-remote | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conf/type/__pf_apply/gencode-remote b/conf/type/__pf_apply/gencode-remote index aa3864b0..9288d3e2 100755 --- a/conf/type/__pf_apply/gencode-remote +++ b/conf/type/__pf_apply/gencode-remote @@ -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 # Ensure that pf is enabled in the first place # 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 -f "${rcvar}" ret="$?" # Cleanup + # This file shouldn't exist, but just in case 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 echo "Failed to configure the new ruleset on ${__target_host}!" >&2 fi