Refactor: Rclone (#7087)

* Refactor

* Update rclone.sh
This commit is contained in:
Slaviša Arežina 2025-08-22 14:15:44 +02:00 committed by GitHub
parent 19365b5083
commit e5a6a5f1c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 18 deletions

View file

@ -28,27 +28,19 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -s https://api.github.com/repos/rclone/rclone/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
if [[ ! -f ~/.rclone ]] || [[ "${RELEASE}" != "$(cat ~/.rclone 2>/dev/null)" ]]; then
msg_info "Stopping Service"
systemctl stop rclone-web
msg_ok "Stopped Service"
msg_info "Updating ${APP} to v${RELEASE}"
temp_file=$(mktemp)
rm -rf /opt/rclone/*
curl -fsSL "https://github.com/rclone/rclone/releases/download/v${RELEASE}/rclone-v${RELEASE}-linux-amd64.zip" -o "$temp_file"
$STD unzip -j "$temp_file" '*/**' -d /opt/rclone
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated $APP to v${RELEASE}"
fetch_and_deploy_gh_release "rclone" "rclone/rclone" "prebuild" "latest" "/opt/rclone" "rclone*linux-amd64.zip"
msg_info "Starting Service"
systemctl start rclone-web
msg_ok "Started Service"
msg_info "Cleaning up"
rm -f "$temp_file"
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"