We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perhaps in a future version we could have a self-update feature?
But in the meantime I wanted to share an update script, might be useful for others :)
#!/bin/bash -ue EXISTING_FILE="/usr/local/bin/SARotate" NEW_FILE="/tmp/SARotate" SAROTATE_SERVICE="sarotate.service" UPDATE_TYPE="SARotate-linux-x64" RELEASE_JSON="$(curl -Ls "https://api.github.com/repos/saltydk/sarotate/releases/latest")" RELEASE_VERSION="$(echo "$RELEASE_JSON" | jq -r '.name')" if [ -f "$EXISTING_FILE" ]; then SAR_VERSION="$("$EXISTING_FILE" --version 2>&1 | cut -f2 -d' ')" fi if [ "${SAR_VERSION-}" != "$RELEASE_VERSION" ]; then echo "Found new update SARotate ${RELEASE_VERSION}, downloading now ..." RELEASE_LINK="$(echo "$RELEASE_JSON" | jq --arg name "$UPDATE_TYPE" -r '.assets[] | select(.name == $name) | .browser_download_url')" curl -Ls "$RELEASE_LINK" -o "$NEW_FILE" echo "Stopping existing service" systemctl stop "$SAROTATE_SERVICE" echo "Installing update" cp "$NEW_FILE" "$EXISTING_FILE" chmod +x "$EXISTING_FILE" rm -f "$NEW_FILE" echo "Restarting system service to apply update" systemctl start "$SAROTATE_SERVICE" echo "All done" fi exit 0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Perhaps in a future version we could have a self-update feature?
But in the meantime I wanted to share an update script, might be useful for others :)
The text was updated successfully, but these errors were encountered: