From 9a45333e82327a4754be0d54c3b083c717cf961e Mon Sep 17 00:00:00 2001 From: Jake Guffey Date: Fri, 21 Sep 2012 10:11:56 -0400 Subject: [PATCH] Implement Nico's suggestions Removed unnecessary code from gencode-remote --- conf/type/__pf_apply/gencode-remote | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/conf/type/__pf_apply/gencode-remote b/conf/type/__pf_apply/gencode-remote index 3045ee60..f7c889b4 100755 --- a/conf/type/__pf_apply/gencode-remote +++ b/conf/type/__pf_apply/gencode-remote @@ -34,24 +34,13 @@ if [ -f "${rcvar}.old" ]; then # rcvar.old exists, we must need to disable pf pfctl -d || true # Cleanup rm -f "${rcvar}.old" - # This file shouldn't exist, but just in case... - if [ -f "${rcvar}" ]; then - rm -f "${rcvar}" - fi 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 - if [ -f "${rcvar}" ]; then - rm -f "${rcvar}" - fi 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" - if [ "\$ret" -ne "0" ]; then # failed to configure new ruleset + if [ "\$?" -ne "0" ]; then # failed to configure new ruleset echo "Failed to configure the new ruleset on ${__target_host}!" >&2 fi fi