Force Update Agent
In some cases, you may need to manually force an update of the Daployi Edge Agent on a host. This script will inspect the currently running agent, preserve its environment variables and security settings, and restart it with the latest version.
Execute Force Update
Run the following command on the host where the agent is installed:
bash -c "$(curl -sSL https://docs.daployi.io/update-agent.sh)"
What this script does:
- Fetches latest version: Queries the Daployi version endpoint to find the most recent agent tag.
- Inspects current container: Extracts environment variables (like
PROJECT_TOKEN) and flags (like--privilegedor--cap-add) from the existingdaployi-agentcontainer. - Pulls new image: Downloads the latest
daployi/daployi-agentimage. - Restarts Agent: Stops and removes the old container, then starts the new one with preserved configuration.