Mercurial > trustbridge
view ui/tests/append-sig.sh @ 1370:289cb3554c55
Fix append-sig.sh to use a temporary file to insert the signature time
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 24 Nov 2014 14:43:36 +0100 |
parents | 8c829345ecfa |
children |
line wrap: on
line source
#!/bin/bash TMPFILE=$(mktemp) cp "$2" "$TMPFILE" CUR_DT=$(date +%s) sed -i "s/###SIGNATURE_DATE###/${CUR_DT}/" "$TMPFILE" echo -e \\r\\nS_DT:$CUR_DT >> "$TMPFILE" cp "$TMPFILE" "$3" echo -e \\r\\nS:$(openssl dgst -sha256 -sign "$1" < "$TMPFILE" | base64 -w0) >> "$3" rm "$TMPFILE"