Update saltstack.sh

This commit is contained in:
Bas van den Berg 2025-05-29 10:17:15 +02:00 committed by GitHub
parent ee80d200d6
commit 13768ea3ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,7 +32,7 @@ function update_script() {
RELEASE=$(curl -fsSL https://api.github.com/repos/saltstack/salt/releases/latest | jq -r .tag_name | sed 's/^v//')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Updating $APP to ${RELEASE}"
sudo sed -i 's/^\(Pin: version \).*/\1${RELEASE}/' /etc/apt/preferences.d/salt-pin-1001
sed -i "s/^\(Pin: version \).*/\1${RELEASE}/" /etc/apt/preferences.d/salt-pin-1001
$STD apt-get update
$STD apt-get upgrade -y
echo "${RELEASE}" >/opt/${APP}_version.txt