Update agent.sh

scripts
Valentin 2023-09-14 23:13:01 +02:00 committed by GitHub
parent d28aa5aeff
commit 3525bf21b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ url=$1
server=$2 server=$2
secret=$3 secret=$3
user=$4 user=$4
rootpath="/opt/accessgate" rootpath="/opt/accessgate_agent"
updateScriptUrl=https://raw.githubusercontent.com/itsmrval/accessgate/scripts/update.sh updateScriptUrl=https://raw.githubusercontent.com/itsmrval/accessgate/scripts/update.sh
@ -32,7 +32,7 @@ echo -ne "✓\n"
echo -ne "[INFO] Testing parameters.. " 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" ] if [ "$secretRequest" = "invalid request" ]
then then
@ -60,7 +60,7 @@ echo -ne "✓\n"
echo -n "[INFO] Creating crontab entry.. " 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 sleep 0.5
echo -ne "✓\n" echo -ne "✓\n"