[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] Check if output argument is given and check non-existance of output dir early



---
 scripts/debian/generate-archive-key | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/debian/generate-archive-key b/scripts/debian/generate-archive-key
index a884e43..03a1da9 100755
--- a/scripts/debian/generate-archive-key
+++ b/scripts/debian/generate-archive-key
@@ -43,6 +43,11 @@ if [[ -z ${conf} ]] || [[ ! -e ${conf} ]]; then
     exit 1
 fi
 
+if [[ -z ${output} ]] || [[ -e ${output} ]]; then
+    echo "No output directory given - or given directory ${output} exists already" >&2
+    exit 2
+fi
+
 . ${conf}
 
 for v in \
@@ -103,9 +108,6 @@ if [[ ${#backup_holders[@]} -lt ${backup_shares} ]]; then
     exit 1
 fi
 
-if [[ -e ${output} ]]; then
-    echo "Output directory already exists" >&2
-    exit 1
 fi
 
 gpghome=$(mktemp -d)
-- 
2.1.4



Reply to: