Replies: 1 comment
-
I agree that would be ideal. However, people have the agent installed and configured in different ways and on different operating systems, so I'm not sure if there's a universal way to do it. If you use Docker, you can auto-update with Watchtower. As long as you pin to a major version it shouldn't break. (I'll double check that the docker images are being tagged properly for major versions and update in the next release if they're not.) If you run binaries, you can use a script like the one below to update them all in one go. The command should be correct if you installed using the official script, otherwise just adjust it for your setup. This would also work for Docker -- you just need to update the command to use #!/bin/bash
# Add all your system hostnames or IPs here
systems=(
"system-one-hostname"
"system-two-hostname"
)
# Command to update the agent
command="sudo /opt/beszel-agent/beszel-agent update && sudo systemctl restart beszel-agent"
# Loop through each system and execute the command
for system in "${systems[@]}"; do
echo "Running command on $system"
# Run the command and capture output and errors
output=$(ssh "$system" "$command" 2>&1)
exit_status=$?
# Print the output and errors
echo "Output from $system:"
echo "$output"
if [ $exit_status -eq 0 ]; then
echo "Command successfully executed on $system"
else
echo "Error executing command on $system with exit status $exit_status"
fi
echo "----------------------------------------"
done |
Beta Was this translation helpful? Give feedback.
-
As the title says, maybe we need a method to update Agent on Hub. I have more than 30+ Systems using beszel. If I need update them by hand, It's need a lot of time to do it.
Beta Was this translation helpful? Give feedback.
All reactions