From bcafc8d41b8681e2480343e2b975d68e9e3aa1ec Mon Sep 17 00:00:00 2001 From: Valentin <43043885+itsmrval@users.noreply.github.com> Date: Sat, 16 Sep 2023 17:08:03 +0200 Subject: [PATCH] Update update.sh --- update.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/update.sh b/update.sh index 005e2f2..643bab1 100644 --- a/update.sh +++ b/update.sh @@ -15,6 +15,7 @@ then then for x in $(head $old_file) do + deluser $x rm /home/$x/.ssh/authorized_keys done fi @@ -22,6 +23,7 @@ then for x in $(head $tmp_file) do + useradd -m $x mkdir -p /home/$x/.ssh curl -o /home/$x/.ssh/authorized_keys -X GET -H 'Content-Type: application/json' -d '{"secret": "'$secret'"}' $url/endpoint/update/$server/key/$x done @@ -36,4 +38,5 @@ else mkdir -p /$user/.ssh/ curl -o /$user/.ssh/authorized_keys -X GET -H 'Content-Type: application/json' -d '{"secret": "'$secret'"}' $url/endpoint/update/$server/allKeys + fi