comparison 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
comparison
equal deleted inserted replaced
1369:948f03bb5254 1370:289cb3554c55
1 #!/bin/bash 1 #!/bin/bash
2 cp "$2" "$3" 2 TMPFILE=$(mktemp)
3 cp "$2" "$TMPFILE"
3 CUR_DT=$(date +%s) 4 CUR_DT=$(date +%s)
4 sed -i "s/###SIGNATURE_DATE###/${CUR_DT}/" "$3" 5 sed -i "s/###SIGNATURE_DATE###/${CUR_DT}/" "$TMPFILE"
5 echo -e \\r\\nS_DT:$CUR_DT >> "$3" 6 echo -e \\r\\nS_DT:$CUR_DT >> "$TMPFILE"
6 echo -e \\r\\nS:$(openssl dgst -sha256 -sign "$1" < "$2" | base64 -w0) >> "$3" 7 cp "$TMPFILE" "$3"
8 echo -e \\r\\nS:$(openssl dgst -sha256 -sign "$1" < "$TMPFILE" | base64 -w0) >> "$3"
9 rm "$TMPFILE"

http://wald.intevation.org/projects/trustbridge/