1
0
mirror of synced 2025-12-28 00:23:25 +00:00

Update agent.sh

This commit is contained in:
Valentin
2023-09-14 23:13:01 +02:00
committed by GitHub
parent d28aa5aeff
commit 3525bf21b7

View File

@@ -4,7 +4,7 @@ url=$1
server=$2
secret=$3
user=$4
rootpath="/opt/accessgate"
rootpath="/opt/accessgate_agent"
updateScriptUrl=https://raw.githubusercontent.com/itsmrval/accessgate/scripts/update.sh
@@ -32,7 +32,7 @@ echo -ne "✓\n"
echo -ne "[INFO] Testing parameters.. "
secretRequest=$(curl -s -X GET -H 'Content-Type: application/json' -d '{"secret": "'$secret'"}' $url/endpoint/update/$server)
secretRequest=$(curl -s -X GET -H 'Content-Type: application/json' -d '{"secret": "'$secret'"}' $url/endpoint/update/$server/users)
if [ "$secretRequest" = "invalid request" ]
then
@@ -60,7 +60,7 @@ echo -ne "✓\n"
echo -n "[INFO] Creating crontab entry.. "
(crontab -u root -l; echo "* * * * * /bin/sh /opt/accessgate/update.sh" ) | crontab -u root -
(crontab -u root -l; echo "* * * * * /bin/sh /opt/accessgate_agent/update.sh" ) | crontab -u root -
sleep 0.5
echo -ne "✓\n"