mirror of https://github.com/itsmrval/accessGate
Update update.sh
parent
599a6a2d07
commit
bcafc8d41b
|
|
@ -15,6 +15,7 @@ then
|
||||||
then
|
then
|
||||||
for x in $(head $old_file)
|
for x in $(head $old_file)
|
||||||
do
|
do
|
||||||
|
deluser $x
|
||||||
rm /home/$x/.ssh/authorized_keys
|
rm /home/$x/.ssh/authorized_keys
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
@ -22,6 +23,7 @@ then
|
||||||
for x in $(head $tmp_file)
|
for x in $(head $tmp_file)
|
||||||
do
|
do
|
||||||
|
|
||||||
|
useradd -m $x
|
||||||
mkdir -p /home/$x/.ssh
|
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
|
curl -o /home/$x/.ssh/authorized_keys -X GET -H 'Content-Type: application/json' -d '{"secret": "'$secret'"}' $url/endpoint/update/$server/key/$x
|
||||||
done
|
done
|
||||||
|
|
@ -36,4 +38,5 @@ else
|
||||||
mkdir -p /$user/.ssh/
|
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
|
curl -o /$user/.ssh/authorized_keys -X GET -H 'Content-Type: application/json' -d '{"secret": "'$secret'"}' $url/endpoint/update/$server/allKeys
|
||||||
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue