From 07c5a9b49e139c57ef3e7c4825acb9765ed3d194 Mon Sep 17 00:00:00 2001 From: Jake Guffey Date: Wed, 19 Sep 2012 17:33:42 -0400 Subject: [PATCH] Migrate conditional syntax set -e doesn't like [ X ] && Y syntax, migrate to if [ X ]; then Y; fi --- conf/type/__pf_apply/gencode-remote | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/conf/type/__pf_apply/gencode-remote b/conf/type/__pf_apply/gencode-remote index 94d02b3b..1185696f 100755 --- a/conf/type/__pf_apply/gencode-remote +++ b/conf/type/__pf_apply/gencode-remote @@ -35,11 +35,15 @@ if [ -f "${rcvar}.old" ]; then # rcvar.old exists, we must need to disable pf # Cleanup rm -f "${rcvar}.old" # This file shouldn't exist, but just in case... - [ -f "${rcvar}" ] && rm -f "${rcvar}" + 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 - [ -f "${rcvar}" ] && rm -f "${rcvar}" + if [ -f "${rcvar}" ]; + rm -f "${rcvar}" + fi mv "${rcvar}.new" "${rcvar}" pfctl -e || true pfctl -f "${rcvar}"