|
| 1 | +#!/usr/bin/env bash |
| 2 | +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) |
| 3 | +# Copyright (c) 2021-2025 community-scripts ORG |
| 4 | +# Author: Slaviša Arežina (tremor021) |
| 5 | +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE |
| 6 | +# Source: https://github.com/rustdesk/rustdesk-server |
| 7 | + |
| 8 | +APP="RustDesk Server" |
| 9 | +TAGS="remote-desktop" |
| 10 | +var_cpu="1" |
| 11 | +var_ram="512" |
| 12 | +var_disk="2" |
| 13 | +var_os="debian" |
| 14 | +var_version="12" |
| 15 | +var_unprivileged="1" |
| 16 | + |
| 17 | +header_info "$APP" |
| 18 | +base_settings |
| 19 | + |
| 20 | +variables |
| 21 | +color |
| 22 | +catch_errors |
| 23 | + |
| 24 | +function update_script() { |
| 25 | + header_info |
| 26 | + check_container_storage |
| 27 | + check_container_resources |
| 28 | + |
| 29 | + if [[ ! -x /usr/bin/hbbr ]]; then |
| 30 | + msg_error "No ${APP} Installation Found!" |
| 31 | + exit |
| 32 | + fi |
| 33 | + RELEASE=$(curl -s https://api.github.com/repos/rustdesk/rustdesk-server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') |
| 34 | + if [[ "${RELEASE}" != "$(cat /opt/rustdesk_version.txt)" ]] || [[ ! -f /opt/rustdesk_version.txt ]]; then |
| 35 | + msg_info "Stopping $APP" |
| 36 | + systemctl stop rustdesk-hbbr |
| 37 | + systemctl stop rustdesk-hbbs |
| 38 | + msg_ok "Stopped $APP" |
| 39 | + |
| 40 | + msg_info "Updating $APP to v${RELEASE}" |
| 41 | + TEMPDIR=$(mktemp -d) |
| 42 | + wget -q "https://github.com/rustdesk/rustdesk-server/releases/download/${RELEASE}/rustdesk-server-hbbr_${RELEASE}_amd64.deb" -P $TEMPDIR |
| 43 | + wget -q "https://github.com/rustdesk/rustdesk-server/releases/download/${RELEASE}/rustdesk-server-hbbs_${RELEASE}_amd64.deb" -P $TEMPDIR |
| 44 | + wget -q "https://github.com/rustdesk/rustdesk-server/releases/download/${RELEASE}/rustdesk-server-utils_${RELEASE}_amd64.deb" -P $TEMPDIR |
| 45 | + dpkg -i $TEMPDIR/*.deb &> /dev/null |
| 46 | + msg_ok "Updated $APP to v${RELEASE}" |
| 47 | + |
| 48 | + msg_info "Cleaning Up" |
| 49 | + rm -rf $TEMPDIR |
| 50 | + msg_ok "Cleanup Completed" |
| 51 | + |
| 52 | + echo "${RELEASE}" >/opt/rustdesk_version.txt |
| 53 | + msg_ok "Update Successful" |
| 54 | + else |
| 55 | + msg_ok "No update required. ${APP} is already at v${RELEASE}" |
| 56 | + fi |
| 57 | + exit |
| 58 | +} |
| 59 | + |
| 60 | +start |
| 61 | +build_container |
| 62 | +description |
| 63 | + |
| 64 | +msg_ok "Completed Successfully!\n" |
| 65 | +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" |
| 66 | +echo -e "${INFO}${YW} Access it using the following URL:${CL}" |
| 67 | +echo -e "${TAB}${GATEWAY}${BGN}${IP}${CL}" |
0 commit comments