Skip to content
This repository has been archived by the owner on May 5, 2019. It is now read-only.

Commit

Permalink
Merge pull request ungleich#634 from darko-poljak/bugfix/consul_#633
Browse files Browse the repository at this point in the history
bugfix: __consul fails if consul is already running #633
  • Loading branch information
darko-poljak committed Feb 25, 2018
2 parents 7cbdc55 + b870b6e commit 4467313
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cdist/conf/type/__consul/gencode-remote
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@ cksum_should=$(cat "$version_dir/cksum" | cut -d' ' -f1,2)
cat << eof
tmpdir=\$(mktemp -d --tmpdir="/tmp" "${__type##*/}.XXXXXXXXXX")
curl -s -L "$source" > "\$tmpdir/$source_file_name"
unzip -p "\$tmpdir/$source_file_name" > "$destination"
unzip -p "\$tmpdir/$source_file_name" > "${destination}.tmp"
rm -rf "\$tmpdir"
cksum_is=\$(cksum "$destination" | cut -d' ' -f1,2)
cksum_is=\$(cksum "${destination}.tmp" | cut -d' ' -f1,2)
if [ "\$cksum_is" = "$cksum_should" ]; then
rm -f "${destination}"
mv "${destination}.tmp" "${destination}"
chown root:root "$destination"
chmod 755 "$destination"
else
rm -f "$destination"
rm -f "${destination}.tmp"
echo "Failed to verify checksum for $__object_name" >&2
exit 1
fi
Expand Down

0 comments on commit 4467313

Please sign in to comment.