From a0e734703384a3ed678ea3930852f8bdf0798fb8 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Thu, 23 Mar 2023 13:52:32 +0900 Subject: [PATCH] Do not run zip command when test flag is set --- bin/create_user.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/bin/create_user.sh b/bin/create_user.sh index 2742a48..e465670 100755 --- a/bin/create_user.sh +++ b/bin/create_user.sh @@ -282,12 +282,21 @@ if [ ${INFO} -eq 1 ]; then exit; fi; # zip everything and remove data in ssh key folder, delete output file with passwords -zip -r \ - "${root_folder}${output_zip_folder}${output_zip}" \ - "${input_file}" \ - "${output_file}" \ - "${ssh_keygen_folder}" \ - -x\*.gitignore; +if [ ${TEST} -eq 0 ]; then + zip -r \ + "${root_folder}${output_zip_folder}${output_zip}" \ + "${input_file}" \ + "${output_file}" \ + "${ssh_keygen_folder}" \ + -x\*.gitignore; +else + echo "zip -r \\" + echo "${root_folder}${output_zip_folder}${output_zip} \\" + echo "${input_file} \\" + echo "${output_file} \\" + echo "${ssh_keygen_folder} \\" + echo "-x\*.gitignore;" +fi; echo "Download: ${root_folder}${output_zip_folder}${output_zip}"; # cleam up user log file and ssh keys if [ ${TEST} -eq 0 ]; then