Exit post-commit hook if no TSA is configured

instead of aborting commit.
This commit is contained in:
Matthias Bühlmann
2021-02-15 18:02:38 +01:00
parent a3e7a2a4a2
commit d8d4a4b506
4 changed files with 58 additions and 23 deletions

View File

@@ -20,7 +20,10 @@
#
# The interactive user interfaces in modified source and object code versions
# of this program must display Appropriate Legal Notices, as required under
# Section 5 of the GNU Affero General Public License version 3.
# Section 5 of the GNU Affero General Public License version 3. In accordance
# with Section 7(b) of the GNU Affero General Public License, you must retain
# the Info line in every timestamp that is created or manipulated using a
# covered work.
#
# You can be released from the requirements of the license by purchasing
# a commercial license. Buying such a license is mandatory as soon as you
@@ -34,12 +37,19 @@
# address: info@mabulous.com
#
#set exit trap to clean up temporary files
TMP_DIR="$(mktemp -d)"
mkdir -p "$TMP_DIR"/ltvdir/certs
mkdir -p "$TMP_DIR"/ltvdir/crls
TMP_LTV_DIR="$TMP_DIR"/ltvdir
#set exit trap to clean up temporary files
exit_trap() {
local EXIT_CODE="$?"
rm -rf -- "$TMP_DIR"
exit "$EXIT_CODE"
}
trap "exit_trap" EXIT
OUT_STREAM=/dev/null
#OUT_STREAM=/dev/stdout
@@ -71,13 +81,6 @@ log() {
echo -e "${DARK_GRAY}$1${NO_COLOR}" > "$OUT_STREAM"
}
exit_trap() {
local EXIT_CODE="$?"
rm -rf -- "$TMP_DIR"
exit "$EXIT_CODE"
}
trap "exit_trap" EXIT
TOKEN_HEADER="-----BEGIN RFC3161 TOKEN-----"
TOKEN_FOOTER="-----END RFC3161 TOKEN-----"
SUBJECT_LINE="-----TIMESTAMP COMMIT-----"