From f0d79d040a5c330bbb766199b800087fc13ab0a2 Mon Sep 17 00:00:00 2001 From: Tails developers Date: Sat, 3 Nov 2012 18:28:43 +0100 Subject: Always remove tempfile if something wrong happen in export-key --- templates/reprepro-export-key.sh.erb | 1 + 1 file changed, 1 insertion(+) (limited to 'templates/reprepro-export-key.sh.erb') diff --git a/templates/reprepro-export-key.sh.erb b/templates/reprepro-export-key.sh.erb index 1bce93f..253672a 100644 --- a/templates/reprepro-export-key.sh.erb +++ b/templates/reprepro-export-key.sh.erb @@ -7,6 +7,7 @@ KEY="$(gpg --homedir '<%= @basedir %>/.gnupg' --with-colon --list-secret-keys | if [ -n "$KEY" ]; then TEMPFILE=$(mktemp) + trap "rm -f '$TEMPFILE'" EXIT DESTFILE='<%= @basedir %>/key.asc' gpg --homedir '<%= @basedir %>/.gnupg' --export --armor $KEY > "$TEMPFILE" mv "$TEMPFILE" "$DESTFILE" -- cgit v1.2.3