From 49e954c648a74d1394ae1b27663709e3667e209c Mon Sep 17 00:00:00 2001 From: Valentin <43043885+itsmrval@users.noreply.github.com> Date: Wed, 13 Sep 2023 15:25:46 +0200 Subject: [PATCH] Update update.sh --- update.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/update.sh b/update.sh index d20d567..3f1bc24 100644 --- a/update.sh +++ b/update.sh @@ -1,4 +1,11 @@ #! /bin/bash . /opt/accessgate/config.txt -curl -o /root/.ssh/authorized_keys -s -X GET -H 'Content-Type: application/json' -d '{"secret": "'$secret'"}' $url/endpoint/update/$server + +if [ $user != "root" ] +then +user="home/$user" +fi + + +curl -o /$user/.ssh/authorized_keys -s -X GET -H 'Content-Type: application/json' -d '{"secret": "'$secret'"}' $url/endpoint/update/$server