Update update.sh

scripts
Valentin 2023-09-16 17:08:03 +02:00 committed by GitHub
parent 599a6a2d07
commit bcafc8d41b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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