Fixed generated code and explorer

Generated code needed subshell escaped
Explorer wasn't parsing output of cksum properly
This commit is contained in:
Jake Guffey 2012-09-19 16:37:18 -04:00
parent a2e96ac435
commit 205f32c78b
2 changed files with 7 additions and 8 deletions

View file

@ -33,7 +33,7 @@ TMP="$(grep '^pf_rules=' ${RC} | cut -d= -f2 | sed 's/"//g')"
PFCONF="${TMP:-"/etc/pf.conf"}"
if [ -f "${PFCONF}" ]; then # The pf config file exists, find its cksum.
cksum -o 1 ${PFCONF} | cut -d= -f2 | sed 's/ //g'
cksum -o 1 ${PFCONF} | cut -d= -f2 | awk '{print $1}'
else # the pf config file doesn't exist
echo NOTEXIST
fi

View file

@ -45,13 +45,13 @@ cksum=$(cat "$__object/explorer/cksum")
cat <<EOF
case $uname in
Darwin)
currentSum=$(cksum -o 1 ${source} | cut '-d ' -f1)
currentSum=\$(cksum -o 1 ${source} | cut '-d ' -f1)
;;
Linux)
currentSum=$(cksum ${source} | cut '-d ' -f1)
currentSum=\$(cksum ${source} | cut '-d ' -f1)
;;
FreeBSD)
currentSum=$(cksum -o 1 ${source} | cut -d= -f2 | sed 's/ //g')
currentSum=\$(cksum -o 1 ${source} | cut -d= -f2 | sed 's/ //g')
;;
*)
echo "Sorry, I do not know how to find a cksum on ${UNAME}." >&2
@ -66,9 +66,8 @@ if [ ! "${cksum}" = "NOTEXIST" ]; then
else # File just doesn't exist yet
$__remote_copy "${source}" "$__target_host:${rcvar}.new"
fi
if [ -n "${testscript}" ]; then
$__remote_copy "${testscript}" "$__target_host:${rcvar}.test"
fi
EOF
# Debug
#exec +x