Skip to content

Commit

Permalink
Excluded updating every time
Browse files Browse the repository at this point in the history
  • Loading branch information
kochetovd committed Nov 20, 2023
1 parent 766d5a4 commit 9b5b0da
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions mysqlconfigurer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ trap on_exit EXIT

function update_agent() {
NEW_VER=$(curl -s -L https://releem.s3.amazonaws.com/v2/current_version_agent)
if [ "$(printf '%s\n' "$NEW_VER" "$VERSION" | sort -V | head -n1)" = "$VERSION" ];
then
printf "\033[37m\n * Updating script \e[31;1m%s\e[0m -> \e[32;1m%s\e[0m\n" "$VERSION" "$NEW_VER"
curl -s -L https://releem.s3.amazonaws.com/v2/install.sh > "$RELEEM_INSTALL_PATH"
RELEEM_API_KEY=$RELEEM_API_KEY exec bash "$RELEEM_INSTALL_PATH" -u
/opt/releem/releem-agent --event=agent_updated > /dev/null
if [ "$NEW_VER" != "$VERSION" ]; then
if [ "$(printf '%s\n' "$NEW_VER" "$VERSION" | sort -V | head -n1)" = "$VERSION" ];
then
printf "\033[37m\n * Updating script \e[31;1m%s\e[0m -> \e[32;1m%s\e[0m\n" "$VERSION" "$NEW_VER"
curl -s -L https://releem.s3.amazonaws.com/v2/install.sh > "$RELEEM_INSTALL_PATH"
RELEEM_API_KEY=$RELEEM_API_KEY exec bash "$RELEEM_INSTALL_PATH" -u
/opt/releem/releem-agent --event=agent_updated > /dev/null
fi
fi
}

Expand Down

0 comments on commit 9b5b0da

Please sign in to comment.