[feat]: migrate all update_scripts to new version helper (gh) (#7262)

* first migrations

* finalize

* add fix kometa inside function
This commit is contained in:
CanbiZ
2025-08-29 12:27:24 +02:00
committed by GitHub
parent 54b59e24ca
commit 9305a4ca85
145 changed files with 1041 additions and 1656 deletions

View File

@@ -20,36 +20,34 @@ color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /lib/systemd/system/watchyourlan.service ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/aceberg/WatchYourLAN/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping service"
systemctl stop watchyourlan.service
msg_ok "Service stopped"
cp -R /data/config.yaml ~/config.yaml
fetch_and_deploy_gh_release "watchyourlan" "aceberg/WatchYourLAN" "binary"
cp -R config.yaml /data/config.yaml
sed -i 's|/etc/watchyourlan/config.yaml|/data/config.yaml|' /lib/systemd/system/watchyourlan.service
msg_info "Cleaning up"
rm ~/config.yaml
msg_ok "Cleaned up"
msg_info "Starting service"
systemctl enable -q --now watchyourlan
msg_ok "Service started"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
header_info
check_container_storage
check_container_resources
if [[ ! -f /lib/systemd/system/watchyourlan.service ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "watchyourlan" "aceberg/WatchYourLAN"; then
msg_info "Stopping service"
systemctl stop watchyourlan.service
msg_ok "Service stopped"
cp -R /data/config.yaml ~/config.yaml
fetch_and_deploy_gh_release "watchyourlan" "aceberg/WatchYourLAN" "binary"
cp -R config.yaml /data/config.yaml
sed -i 's|/etc/watchyourlan/config.yaml|/data/config.yaml|' /lib/systemd/system/watchyourlan.service
msg_info "Cleaning up"
rm ~/config.yaml
msg_ok "Cleaned up"
msg_info "Starting service"
systemctl enable -q --now watchyourlan
msg_ok "Service started"
msg_ok "Updated Successfully"
fi
exit
}
start