diff --git a/ct/beszel.sh b/ct/beszel.sh index e45d000f3..fa093a11c 100644 --- a/ct/beszel.sh +++ b/ct/beszel.sh @@ -27,19 +27,22 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - msg_info "Stopping Service" - systemctl stop beszel-hub - msg_info "Stopped Service" - msg_info "Updating $APP" - $STD /opt/beszel/beszel update - sleep 2 && chmod +x /opt/beszel/beszel - msg_ok "Updated $APP" + if check_for_gh_release "beszel" "henrygd/beszel"; then + msg_info "Stopping Service" + systemctl stop beszel-hub + msg_info "Stopped Service" - msg_info "Starting Service" - systemctl start beszel-hub - msg_ok "Successfully started $APP" - msg_ok "Updated successfully!" + msg_info "Updating Beszel" + $STD /opt/beszel/beszel update + sleep 2 && chmod +x /opt/beszel/beszel + msg_ok "Updated Beszel" + + msg_info "Starting Service" + systemctl start beszel-hub + msg_ok "Started Service" + msg_ok "Updated successfully!" + fi exit } diff --git a/install/beszel-install.sh b/install/beszel-install.sh index ef88a70ab..35bdea2fb 100644 --- a/install/beszel-install.sh +++ b/install/beszel-install.sh @@ -13,11 +13,7 @@ setting_up_container network_check update_os -msg_info "Installing Beszel" -mkdir -p /opt/beszel -curl -fsSL "https://github.com/henrygd/beszel/releases/latest/download/beszel_$(uname -s)_$(uname -m | sed -e 's/x86_64/amd64/' -e 's/armv6l/arm/' -e 's/armv7l/arm/' -e 's/aarch64/arm64/').tar.gz" | tar -xz -O beszel | tee /opt/beszel/beszel >/dev/null -chmod +x /opt/beszel/beszel -msg_ok "Installed Beszel" +fetch_and_deploy_gh_release "beszel" "henrygd/beszel" "prebuild" "latest" "/opt/beszel" "beszel_linux_amd64.tar.gz" msg_info "Creating Service" cat </etc/systemd/system/beszel-hub.service