Fix: Update use of cmp to expect correct exit code

This update to the usage of `cmp` in the anchor scripts will cause the
scripts to overwrite existing manifests whenever differences are
detected.

This should only occur during genesis, but may occur if a file is
accidentily modified on a node and the anchor then checks the file for
changes.

Change-Id: Ic594fef2c5a5c30a5be3ccc7ab51efcd29c8cdcc
This commit is contained in:
Mark Burnett 2017-11-17 16:37:47 -06:00
parent 51df4ce078
commit 19a730a1c4
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ set -x
compare_copy_files() {
{{range .Values.anchor.files_to_copy}}
if [ ! -e /host{{ .dest }} ] || cmp -s {{ .source }} /host{{ .dest }}; then
if [ ! -e /host{{ .dest }} ] || ! cmp -s {{ .source }} /host{{ .dest }}; then
mkdir -p $(dirname /host{{ .dest }})
cp {{ .source }} /host{{ .dest }}
fi

View File

@ -18,7 +18,7 @@ set -x
compare_copy_files() {
{{range .Values.anchor.files_to_copy}}
if [ ! -e /host{{ .dest }} ] || cmp -s {{ .source }} /host{{ .dest }}; then
if [ ! -e /host{{ .dest }} ] || ! cmp -s {{ .source }} /host{{ .dest }}; then
mkdir -p $(dirname /host{{ .dest }})
cp {{ .source }} /host{{ .dest }}
fi