Skip to content

Commit

Permalink
uninstall first before installation (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
uubulb authored Nov 30, 2024
1 parent c113988 commit 04f75e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion agent/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ install() {

env="NZ_SERVER=$NZ_SERVER NZ_CLIENT_SECRET=$NZ_CLIENT_SECRET NZ_TLS=$NZ_TLS NZ_DISABLE_AUTO_UPDATE=$NZ_DISABLE_AUTO_UPDATE NZ_DISABLE_FORCE_UPDATE=$DISABLE_FORCE_UPDATE NZ_DISABLE_COMMAND_EXECUTE=$NZ_DISABLE_COMMAND_EXECUTE NZ_SKIP_CONNECTION_COUNT=$NZ_SKIP_CONNECTION_COUNT"

_cmd="sudo env $env $NZ_AGENT_PATH/nezha-agent service -c "$path" install"
sudo "${NZ_AGENT_PATH}"/nezha-agent service -c "$path" uninstall >/dev/null 2>&1
_cmd="sudo env $env $NZ_AGENT_PATH/nezha-agent service -c $path install"
if ! eval "$_cmd"; then
err "Install nezha-agent service failed"
exit 1
Expand Down

0 comments on commit 04f75e5

Please sign in to comment.