This commit is contained in:
Slaviša Arežina
2025-12-17 16:34:36 +01:00
committed by GitHub
parent dcc4b316a9
commit c4afe3349b
2 changed files with 10 additions and 15 deletions
+3 -5
View File
@@ -29,16 +29,14 @@ function update_script() {
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/saltstack/salt/releases/latest | jq -r .tag_name | sed 's/^v//')
if [[ ! -f /~.salt ]] || [[ "${RELEASE}" != "$(cat /~.salt)" ]]; then
msg_info "Updating $APP to ${RELEASE}"
RELEASE=$(get_latest_github_release "saltstack/salt")
if check_for_gh_release "salt" "saltstack/salt"; then
msg_info "Updating Salt"
sed -i "s/^\(Pin: version \).*/\1${RELEASE}/" /etc/apt/preferences.d/salt-pin-1001
$STD apt update
$STD apt upgrade -y
echo "${RELEASE}" >/~.salt
msg_ok "Updated successfully!"
else
msg_ok "${APP} is already up to date (${RELEASE})"
fi
exit
}