From e02822f06d188341bb6ac9258ed3b55d60c0072b Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Thu, 1 Jun 2023 15:30:19 +0900 Subject: [PATCH] wrong order for not moved ssh key check with master users --- bin/authorized_key_location_change.sh.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/authorized_key_location_change.sh.sh b/bin/authorized_key_location_change.sh.sh index fe40f0e..6c928a4 100755 --- a/bin/authorized_key_location_change.sh.sh +++ b/bin/authorized_key_location_change.sh.sh @@ -102,14 +102,14 @@ while read user_home; do ssh_key_diff=$(diff -u "${home_folder}/.ssh/authorized_keys" "${SSH_CENTRAL_AUTHORIZED_FILE_FOLDER}/${username}"); if [ -z "${ssh_key_diff}" ]; then printf "${PRINTF_INFO}" "REMOVE" "-" "${username}" ".ssh/authorized_keys"; - if [ ${TEST} -eq 0 ]; then - if [ ${master_user} -eq 0 ]; then + if [ ${master_user} -eq 0 ]; then + if [ ${TEST} -eq 0 ]; then rm "${home_folder}/.ssh/authorized_keys"; else - echo "[!] No delete for master user, must be done manually"; + echo "$> rm \"${home_folder}/.ssh/authorized_keys\""; fi; else - echo "$> rm \"${home_folder}/.ssh/authorized_keys\""; + echo "[!] No delete for master user, must be done manually"; fi; continue; fi;