From 9f61b3c5230f6dbdd708ddd2ca8bcda0f79ebcd4 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Fri, 4 Nov 2022 10:43:47 +0900 Subject: [PATCH] Switch to different zip/pwgen exists bash check --- bin/user_create.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/user_create.sh b/bin/user_create.sh index d6e4559..9ee4e0f 100755 --- a/bin/user_create.sh +++ b/bin/user_create.sh @@ -58,17 +58,19 @@ if [ ! -d "${root_folder}${output_zip_folder}" ]; then mkdir "${root_folder}${output_zip_folder}"; fi; # check if password generate software is installed -if [ ! command -v pwgen &> /dev/null ]; then +# if [ ! command -v pwgen &> /dev/null ]; then +if [ -z $(command -v pwgen) ]; then echo "Missing pwgen application, aborting"; exit; fi; # check for zip -if [ ! command -v zip &> /dev/null ]; then +# if [ ! command -v zip &> /dev/null ]; then +if [ -z $(command -v zip) ]; then echo "Missing zip application, aborting"; exit; fi; # check if sshallow group exists -if [ -z $(cat /etc/group|grep "${ssh_group}:") ]; then +if [ -z $(cat /etc/group | grep "${ssh_group}:") ]; then echo "Missing ssh access group: ${ssh_group}"; exit; fi;