AgentDVR: Added update function (#6804)

* Update

* Update json
This commit is contained in:
Slaviša Arežina 2025-08-13 20:59:43 +02:00 committed by GitHub
parent c759269f0a
commit 047c7fe53c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 26 additions and 2 deletions

View File

@ -27,7 +27,30 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
msg_error "Currently we don't provide an update function for this ${APP}."
RELEASE=$(curl -fsSL "https://www.ispyconnect.com/api/Agent/DownloadLocation4?platform=Linux64&fromVersion=0" | grep -o 'https://.*\.zip')
if [[ "${RELEASE}" != "$(cat ~/.agentdvr 2>/dev/null)" ]] || [[ ! -f ~/.agentdvr ]]; then
msg_info "Stopping service"
systemctl stop AgentDVR
msg_ok "Service stopped"
msg_info "Updating $APP"
cd /opt/agentdvr/agent
curl -fsSL "$RELEASE" -o $(basename "$RELEASE")
$STD unzip -o Agent_Linux64*.zip
chmod +x ./Agent
echo $RELEASE > ~/.agentdvr
rm -rf Agent_Linux64*.zip
msg_ok "Updated $APP"
msg_info "Starting service"
systemctl start AgentDVR
msg_ok "Service started"
msg_ok "Updated $APP successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
}

View File

@ -6,7 +6,7 @@
],
"date_created": "2024-05-02",
"type": "ct",
"updateable": false,
"updateable": true,
"privileged": true,
"interface_port": 8090,
"documentation": "https://www.ispyconnect.com/docs/agent/about",

View File

@ -29,6 +29,7 @@ cd /opt/agentdvr/agent
curl -fsSL "$RELEASE" -o $(basename "$RELEASE")
$STD unzip Agent_Linux64*.zip
chmod +x ./Agent
echo $RELEASE > ~/.agentdvr
msg_ok "Installed AgentDVR"
msg_info "Creating Service"