From eb7ce528af636ef4b9d506d03bd243be9b153677 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Tue, 4 Jul 2023 12:00:29 +0100 Subject: [PATCH 01/17] Update install.sh --- install.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/install.sh b/install.sh index ace4633..596f725 100644 --- a/install.sh +++ b/install.sh @@ -96,9 +96,9 @@ fi # Setting up firewall -ufw allow 21115:21119/tcp -ufw allow 22/tcp -ufw allow 21116/udp +sudo ufw allow 21115:21119/tcp +sudo ufw allow 22/tcp +sudo ufw allow 21116/udp sudo ufw enable # Make Folder /var/lib/rustdesk-server/ @@ -230,9 +230,9 @@ select WANOPT in "${WAN[@]}"; do case $WANOPT in "IP") wanip=$(dig @resolver4.opendns.com myip.opendns.com +short) -ufw allow 21114/tcp +sudo ufw allow 21114/tcp -ufw enable && ufw reload +sudo ufw enable && ufw reload break ;; @@ -244,8 +244,8 @@ if ! [[ $wanip =~ ^[a-zA-Z0-9]+([a-zA-Z0-9.-]*[a-zA-Z0-9]+)?$ ]]; then echo -e "${RED}Invalid domain/dns address${NC}" exit 1 fi -apt -y install nginx -apt -y install python3-certbot-nginx +sudo apt -y install nginx +sudo apt -y install python3-certbot-nginx rustdesknginx="$( cat < Date: Tue, 4 Jul 2023 12:02:20 +0100 Subject: [PATCH 02/17] Update install.sh --- install.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 596f725..9e98a10 100644 --- a/install.sh +++ b/install.sh @@ -119,30 +119,30 @@ if [ "${ARCH}" = "x86_64" ] ; then wget https://github.com/rustdesk/rustdesk-server-pro/releases/download/1.1.8/rustdesk-server-linux-amd64.zip unzip rustdesk-server-linux-amd64.zip mv amd64/static /var/lib/rustdesk-server/ -mv amd64/hbbr /usr/bin/ -mv amd64/hbbs /usr/bin/ +sudo mv amd64/hbbr /usr/bin/ +sudo mv amd64/hbbs /usr/bin/ rm -rf amd64/ rm -rf rustdesk-server-linux-amd64.zip elif [ "${ARCH}" = "armv7l" ] ; then wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-armv7.zip" unzip rustdesk-server-linux-armv7.zip mv armv7/static /var/lib/rustdesk-server/ -mv armv7/hbbr /usr/bin/ -mv armv7/hbbs /usr/bin/ +sudo mv armv7/hbbr /usr/bin/ +sudo mv armv7/hbbs /usr/bin/ rm -rf armv7/ rm -rf rustdesk-server-linux-armv7.zip elif [ "${ARCH}" = "aarch64" ] ; then wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-arm64v8.zip" unzip rustdesk-server-linux-arm64v8.zip mv arm64v8/static /var/lib/rustdesk-server/ -mv arm64v8/hbbr /usr/bin/ -mv arm64v8/hbbs /usr/bin/ +sudo mv arm64v8/hbbr /usr/bin/ +sudo mv arm64v8/hbbs /usr/bin/ rm -rf arm64v8/ rm -rf rustdesk-server-linux-arm64v8.zip fi -chmod +x /usr/bin/hbbs -chmod +x /usr/bin/hbbr +sudo chmod +x /usr/bin/hbbs +sudo chmod +x /usr/bin/hbbr # Make Folder /var/log/rustdesk/ From 6c7f24b739f5d9b48e0a0c964948fd40bb25e997 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Tue, 4 Jul 2023 12:08:02 +0100 Subject: [PATCH 03/17] Update install.sh --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 9e98a10..87e734c 100644 --- a/install.sh +++ b/install.sh @@ -259,8 +259,8 @@ EOF )" echo "${rustdesknginx}" | sudo tee /etc/nginx/sites-available/rustdesk.conf >/dev/null -rm /etc/nginx/sites-available/default -rm /etc/nginx/sites-enabled/default +sudo rm /etc/nginx/sites-available/default +sudo rm /etc/nginx/sites-enabled/default sudo ln -s /etc/nginx/sites-available/rustdesk.conf /etc/nginx/sites-enabled/rustdesk.conf From e4f0fb2236a6f4e936181653bbbfd3001cd61d1a Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Tue, 4 Jul 2023 12:09:15 +0100 Subject: [PATCH 04/17] Create convertfromos.sh --- convertfromos.sh | 294 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 294 insertions(+) create mode 100644 convertfromos.sh diff --git a/convertfromos.sh b/convertfromos.sh new file mode 100644 index 0000000..9af7d19 --- /dev/null +++ b/convertfromos.sh @@ -0,0 +1,294 @@ +#!/bin/bash + +# This script will do the following to install RustDesk Pro replacing RustDesk Opensource +# 1. Install some dependencys +# 2. Setup ufw firewall if available +# 3. Create a Folder /var/lib/rustdesk-server and copy the certs here +# 4. Download and extract RustDesk Pro Services to the above folder +# 5. Create systemd services for hbbs and hbbr +# 6. If you chose Domain, it will install Nginx and certbot, allowing the API to be available on port 443 (https) and get an SSL certificate over port 80, this will autorenew. + +# Get Username +uname=$(whoami) +admintoken=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c16) + +sudo systemctl stop gohttpserver.service +sudo systemctl stop rustdesksignal.service +sudo systemctl stop rustdeskrelay.service +sudo systemctl disable rustdesksignal.service +sudo systemctl disable rustdeskrelay.service +sudo systemctl disable gohttpserver.service +sudo rm /etc/systemd/system/gohttpserver.service +sudo rm /etc/systemd/system/rustdeskrelay.service +sudo rm /etc/systemd/system/rustdesksignal.service + + +ARCH=$(uname -m) + + +# identify OS +if [ -f /etc/os-release ]; then + # freedesktop.org and systemd + . /etc/os-release + OS=$NAME + VER=$VERSION_ID + + UPSTREAM_ID=${ID_LIKE,,} + + # Fallback to ID_LIKE if ID was not 'ubuntu' or 'debian' + if [ "${UPSTREAM_ID}" != "debian" ] && [ "${UPSTREAM_ID}" != "ubuntu" ]; then + UPSTREAM_ID="$(echo ${ID_LIKE,,} | sed s/\"//g | cut -d' ' -f1)" + fi + + +elif type lsb_release >/dev/null 2>&1; then + # linuxbase.org + OS=$(lsb_release -si) + VER=$(lsb_release -sr) +elif [ -f /etc/lsb-release ]; then + # For some versions of Debian/Ubuntu without lsb_release command + . /etc/lsb-release + OS=$DISTRIB_ID + VER=$DISTRIB_RELEASE +elif [ -f /etc/debian_version ]; then + # Older Debian/Ubuntu/etc. + OS=Debian + VER=$(cat /etc/debian_version) +elif [ -f /etc/SuSe-release ]; then + # Older SuSE/etc. + OS=SuSE + VER=$(cat /etc/SuSe-release) +elif [ -f /etc/redhat-release ]; then + # Older Red Hat, CentOS, etc. + OS=RedHat + VER=$(cat /etc/redhat-release) +else + # Fall back to uname, e.g. "Linux ", also works for BSD, etc. + OS=$(uname -s) + VER=$(uname -r) +fi + + +# output ebugging info if $DEBUG set +if [ "$DEBUG" = "true" ]; then + echo "OS: $OS" + echo "VER: $VER" + echo "UPSTREAM_ID: $UPSTREAM_ID" + exit 0 +fi + +# Setup prereqs for server +# common named prereqs +PREREQ="curl wget unzip tar" +PREREQDEB="dnsutils ufw" +PREREQRPM="bind-utils" +PREREQARCH="bind" + +echo "Installing prerequisites" +if [ "${ID}" = "debian" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Debian" ] || [ "${UPSTREAM_ID}" = "ubuntu" ] || [ "${UPSTREAM_ID}" = "debian" ]; then + sudo apt-get update + sudo apt-get install -y ${PREREQ} ${PREREQDEB} # git +elif [ "$OS" = "CentOS" ] || [ "$OS" = "RedHat" ] || [ "${UPSTREAM_ID}" = "rhel" ] ; then +# opensuse 15.4 fails to run the relay service and hangs waiting for it +# needs more work before it can be enabled +# || [ "${UPSTREAM_ID}" = "suse" ] + sudo yum update -y + sudo yum install -y ${PREREQ} ${PREREQRPM} # git +elif [ "${ID}" = "arch" ] || [ "${UPSTREAM_ID}" = "arch" ]; then + sudo pacman -Syu + sudo pacman -S ${PREREQ} ${PREREQARCH} +else + echo "Unsupported OS" + # here you could ask the user for permission to try and install anyway + # if they say yes, then do the install + # if they say no, exit the script + exit 1 +fi + +# Setting up firewall + +sudo ufw allow 21115:21119/tcp +sudo ufw allow 22/tcp +sudo ufw allow 21116/udp +sudo ufw enable + +# Make Folder /var/lib/rustdesk-server/ +if [ ! -d "/var/lib/rustdesk-server" ]; then + echo "Creating /var/lib/rustdesk-server" + sudo mkdir -p /var/lib/rustdesk-server/ +fi + +sudo chown "${uname}" -R /var/lib/rustdesk-server +cd /var/lib/rustdesk-server/ || exit 1 + +mv /opt/rustdesk/id_* /var/lib/rustdesk-server/ + + +#Download latest version of Rustdesk +RDLATEST=$(curl https://api.github.com/repos/rustdesk/rustdesk-server-pro/releases/latest -s | grep "tag_name"| awk '{print substr($2, 2, length($2)-3) }') + +echo "Installing Rustdesk Server" +if [ "${ARCH}" = "x86_64" ] ; then +wget https://github.com/rustdesk/rustdesk-server-pro/releases/download/1.1.8/rustdesk-server-linux-amd64.zip +unzip rustdesk-server-linux-amd64.zip +mv amd64/static /var/lib/rustdesk-server/ +sudo mv amd64/hbbr /usr/bin/ +sudo mv amd64/hbbs /usr/bin/ +rm -rf amd64/ +rm -rf rustdesk-server-linux-amd64.zip +elif [ "${ARCH}" = "armv7l" ] ; then +wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-armv7.zip" +unzip rustdesk-server-linux-armv7.zip +mv armv7/static /var/lib/rustdesk-server/ +sudo mv armv7/hbbr /usr/bin/ +sudo mv armv7/hbbs /usr/bin/ +rm -rf armv7/ +rm -rf rustdesk-server-linux-armv7.zip +elif [ "${ARCH}" = "aarch64" ] ; then +wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-arm64v8.zip" +unzip rustdesk-server-linux-arm64v8.zip +mv arm64v8/static /var/lib/rustdesk-server/ +sudo mv arm64v8/hbbr /usr/bin/ +sudo mv arm64v8/hbbs /usr/bin/ +rm -rf arm64v8/ +rm -rf rustdesk-server-linux-arm64v8.zip +fi + +sudo chmod +x /usr/bin/hbbs +sudo chmod +x /usr/bin/hbbr + + +# Make Folder /var/log/rustdesk/ +if [ ! -d "/var/log/rustdesk" ]; then + echo "Creating /var/log/rustdesk" + sudo mkdir -p /var/log/rustdesk/ +fi +sudo chown "${uname}" -R /var/log/rustdesk/ + +# Setup Systemd to launch hbbs +rustdeskhbbs="$(cat << EOF +[Unit] +Description=Rustdesk Signal Server +[Service] +Type=simple +LimitNOFILE=1000000 +ExecStart=/usr/bin/hbbs +WorkingDirectory=/var/lib/rustdesk-server/ +User=${uname} +Group=${uname} +Restart=always +StandardOutput=append:/var/log/rustdesk/rustdeskhbbs.log +StandardError=append:/var/log/rustdesk/rustdeskhbbs.error +# Restart service after 10 seconds if node service crashes +RestartSec=10 +[Install] +WantedBy=multi-user.target +EOF +)" +echo "${rustdeskhbbs}" | sudo tee /etc/systemd/system/rustdeskhbbs.service > /dev/null +sudo systemctl daemon-reload +sudo systemctl enable rustdeskhbbs.service +sudo systemctl start rustdeskhbbs.service + +# Setup Systemd to launch hbbr +rustdeskhbbr="$(cat << EOF +[Unit] +Description=Rustdesk Relay Server +[Service] +Type=simple +LimitNOFILE=1000000 +ExecStart=/usr/bin/hbbr +WorkingDirectory=/var/lib/rustdesk-server/ +User=${uname} +Group=${uname} +Restart=always +StandardOutput=append:/var/log/rustdesk/rustdeskhbbr.log +StandardError=append:/var/log/rustdesk/rustdeskhbbr.error +# Restart service after 10 seconds if node service crashes +RestartSec=10 +[Install] +WantedBy=multi-user.target +EOF +)" +echo "${rustdeskhbbr}" | sudo tee /etc/systemd/system/rustdeskhbbr.service > /dev/null +sudo systemctl daemon-reload +sudo systemctl enable rustdeskhbbr.service +sudo systemctl start rustdeskhbbr.service + +while ! [[ $CHECK_RUSTDESK_READY ]]; do + CHECK_RUSTDESK_READY=$(sudo systemctl status rustdeskhbbr.service | grep "Active: active (running)") + echo -ne "Rustdesk Relay not ready yet...${NC}\n" + sleep 3 +done + +pubname=$(find /var/lib/rustdesk-server/ -name "*.pub") +key=$(cat "${pubname}") + +echo "Tidying up install" +if [ "${ARCH}" = "x86_64" ] ; then +rm rustdesk-server-linux-amd64.zip +rm -rf amd64 +elif [ "${ARCH}" = "armv7l" ] ; then +rm rustdesk-server-linux-armv7.zip +rm -rf armv7 +elif [ "${ARCH}" = "aarch64" ] ; then +rm rustdesk-server-linux-arm64v8.zip +rm -rf arm64v8 +fi + +# Choice for DNS or IP +PS3='Choose your preferred option, IP or DNS/Domain:' +WAN=("IP" "DNS/Domain") +select WANOPT in "${WAN[@]}"; do +case $WANOPT in +"IP") +wanip=$(dig @resolver4.opendns.com myip.opendns.com +short) +sudo ufw allow 21114/tcp + +sudo ufw enable && ufw reload +break +;; + +"DNS/Domain") +echo -ne "Enter your preferred domain/dns address ${NC}: " +read wanip +#check wanip is valid domain +if ! [[ $wanip =~ ^[a-zA-Z0-9]+([a-zA-Z0-9.-]*[a-zA-Z0-9]+)?$ ]]; then + echo -e "${RED}Invalid domain/dns address${NC}" + exit 1 +fi +sudo apt -y install nginx +sudo apt -y install python3-certbot-nginx + +rustdesknginx="$( + cat </dev/null + +sudo rm /etc/nginx/sites-available/default +sudo rm /etc/nginx/sites-enabled/default + +sudo ln -s /etc/nginx/sites-available/rustdesk.conf /etc/nginx/sites-enabled/rustdesk.conf + +sudo ufw allow 80/tcp +sudo ufw allow 443/tcp + +sudo ufw enable && ufw reload + +sudo certbot --nginx -d ${wanip} + +break +;; +*) echo "invalid option $REPLY";; +esac +done + +echo -e "Your IP/DNS Address is ${wanip}" +echo -e "Your public key is ${key}" From 97b44c5f9d98ed90538ae416018d1bd87f4d1a81 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Tue, 4 Jul 2023 12:10:22 +0100 Subject: [PATCH 05/17] Update update.sh --- update.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/update.sh b/update.sh index c27f64d..bca0f80 100644 --- a/update.sh +++ b/update.sh @@ -82,30 +82,30 @@ if [ "${ARCH}" = "x86_64" ] ; then wget https://github.com/rustdesk/rustdesk-server-pro/releases/download/1.1.8/rustdesk-server-linux-amd64.zip unzip rustdesk-server-linux-amd64.zip mv amd64/static /var/lib/rustdesk-server/ -mv amd64/hbbr /usr/bin/ -mv amd64/hbbs /usr/bin/ +sudo mv amd64/hbbr /usr/bin/ +sudo mv amd64/hbbs /usr/bin/ rm -rf amd64/ rm -rf rustdesk-server-linux-amd64.zip elif [ "${ARCH}" = "armv7l" ] ; then wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-armv7.zip" unzip rustdesk-server-linux-armv7.zip mv armv7/static /var/lib/rustdesk-server/ -mv armv7/hbbr /usr/bin/ -mv armv7/hbbs /usr/bin/ +sudo mv armv7/hbbr /usr/bin/ +sudo mv armv7/hbbs /usr/bin/ rm -rf armv7/ rm -rf rustdesk-server-linux-armv7.zip elif [ "${ARCH}" = "aarch64" ] ; then wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-arm64v8.zip" unzip rustdesk-server-linux-arm64v8.zip mv arm64v8/static /var/lib/rustdesk-server/ -mv arm64v8/hbbr /usr/bin/ -mv arm64v8/hbbs /usr/bin/ +sudo mv arm64v8/hbbr /usr/bin/ +sudo mv arm64v8/hbbs /usr/bin/ rm -rf arm64v8/ rm -rf rustdesk-server-linux-arm64v8.zip fi -chmod +x /usr/bin/hbbs -chmod +x /usr/bin/hbbr +sudo chmod +x /usr/bin/hbbs +sudo chmod +x /usr/bin/hbbr sudo systemctl start rustdesk-hbbs.service sudo systemctl start rustdesk-hbbr.service From 783e1f8fcfb1bdd8754447e2bb6c183cc018cf96 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Tue, 4 Jul 2023 12:11:18 +0100 Subject: [PATCH 06/17] Update update.sh --- update.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/update.sh b/update.sh index bca0f80..c50cf65 100644 --- a/update.sh +++ b/update.sh @@ -12,8 +12,8 @@ if [ $RDLATEST == $RDCURRENT ]; then exit 0 fi -sudo systemctl stop rustdesk-hbbs.service -sudo systemctl stop rustdesk-hbbr.service +sudo systemctl stop rustdeskhbbs.service +sudo systemctl stop rustdeskhbbr.service sleep 20 ARCH=$(uname -m) @@ -107,11 +107,11 @@ fi sudo chmod +x /usr/bin/hbbs sudo chmod +x /usr/bin/hbbr -sudo systemctl start rustdesk-hbbs.service -sudo systemctl start rustdesk-hbbr.service +sudo systemctl start rustdeskhbbs.service +sudo systemctl start rustdeskhbbr.service while ! [[ $CHECK_RUSTDESK_READY ]]; do - CHECK_RUSTDESK_READY=$(sudo systemctl status rustdesk-hbbr.service | grep "Active: active (running)") + CHECK_RUSTDESK_READY=$(sudo systemctl status rustdeskhbbr.service | grep "Active: active (running)") echo -ne "Rustdesk Relay not ready yet...${NC}\n" sleep 3 done From 2e4f4323c9ad3fd37a5261838dae47dc56bd1205 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Tue, 4 Jul 2023 12:16:52 +0100 Subject: [PATCH 07/17] Update convertfromos.sh --- convertfromos.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/convertfromos.sh b/convertfromos.sh index 9af7d19..cda1c69 100644 --- a/convertfromos.sh +++ b/convertfromos.sh @@ -1,12 +1,13 @@ #!/bin/bash # This script will do the following to install RustDesk Pro replacing RustDesk Opensource -# 1. Install some dependencys -# 2. Setup ufw firewall if available -# 3. Create a Folder /var/lib/rustdesk-server and copy the certs here -# 4. Download and extract RustDesk Pro Services to the above folder -# 5. Create systemd services for hbbs and hbbr -# 6. If you chose Domain, it will install Nginx and certbot, allowing the API to be available on port 443 (https) and get an SSL certificate over port 80, this will autorenew. +# 1. Disable and removes the old services +# 2. Install some dependencys +# 3. Setup ufw firewall if available +# 4. Create a Folder /var/lib/rustdesk-server and copy the certs here +# 5. Download and extract RustDesk Pro Services to the above folder +# 6. Create systemd services for hbbs and hbbr +# 7. If you chose Domain, it will install Nginx and certbot, allowing the API to be available on port 443 (https) and get an SSL certificate over port 80, this will autorenew. # Get Username uname=$(whoami) @@ -123,6 +124,7 @@ cd /var/lib/rustdesk-server/ || exit 1 mv /opt/rustdesk/id_* /var/lib/rustdesk-server/ +sudo rm -rf /opt/rustdesk #Download latest version of Rustdesk RDLATEST=$(curl https://api.github.com/repos/rustdesk/rustdesk-server-pro/releases/latest -s | grep "tag_name"| awk '{print substr($2, 2, length($2)-3) }') From f0b18af2ff2b2a7ab63cbb0d83163c2dd11bbc45 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Wed, 5 Jul 2023 09:20:42 +0100 Subject: [PATCH 08/17] Update convertfromos.sh --- convertfromos.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/convertfromos.sh b/convertfromos.sh index cda1c69..489cc16 100644 --- a/convertfromos.sh +++ b/convertfromos.sh @@ -160,12 +160,13 @@ sudo chmod +x /usr/bin/hbbs sudo chmod +x /usr/bin/hbbr -# Make Folder /var/log/rustdesk/ -if [ ! -d "/var/log/rustdesk" ]; then - echo "Creating /var/log/rustdesk" - sudo mkdir -p /var/log/rustdesk/ +# Make Folder /var/log/rustdesk-server/ +if [ ! -d "/var/log/rustdesk-server" ]; then + echo "Creating /var/log/rustdesk-server" + sudo mkdir -p /var/log/rustdesk-server/ fi -sudo chown "${uname}" -R /var/log/rustdesk/ +sudo chown "${uname}" -R /var/log/rustdesk-server/ +sudo rm -rf /var/log/rustdesk/ # Setup Systemd to launch hbbs rustdeskhbbs="$(cat << EOF @@ -179,8 +180,8 @@ WorkingDirectory=/var/lib/rustdesk-server/ User=${uname} Group=${uname} Restart=always -StandardOutput=append:/var/log/rustdesk/rustdeskhbbs.log -StandardError=append:/var/log/rustdesk/rustdeskhbbs.error +StandardOutput=append:/var/log/rustdesk-server/rustdeskhbbs.log +StandardError=append:/var/log/rustdesk-server/rustdeskhbbs.error # Restart service after 10 seconds if node service crashes RestartSec=10 [Install] @@ -204,8 +205,8 @@ WorkingDirectory=/var/lib/rustdesk-server/ User=${uname} Group=${uname} Restart=always -StandardOutput=append:/var/log/rustdesk/rustdeskhbbr.log -StandardError=append:/var/log/rustdesk/rustdeskhbbr.error +StandardOutput=append:/var/log/rustdesk-server/rustdeskhbbr.log +StandardError=append:/var/log/rustdesk-server/rustdeskhbbr.error # Restart service after 10 seconds if node service crashes RestartSec=10 [Install] From 8c2d53977c8bd06c6b7686be467d0cf3dd8a3411 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Wed, 5 Jul 2023 09:21:48 +0100 Subject: [PATCH 09/17] Update install.sh --- install.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/install.sh b/install.sh index 87e734c..40171f5 100644 --- a/install.sh +++ b/install.sh @@ -145,12 +145,12 @@ sudo chmod +x /usr/bin/hbbs sudo chmod +x /usr/bin/hbbr -# Make Folder /var/log/rustdesk/ -if [ ! -d "/var/log/rustdesk" ]; then - echo "Creating /var/log/rustdesk" - sudo mkdir -p /var/log/rustdesk/ +# Make Folder /var/log/rustdesk-server/ +if [ ! -d "/var/log/rustdesk-server" ]; then + echo "Creating /var/log/rustdesk-server" + sudo mkdir -p /var/log/rustdesk-server/ fi -sudo chown "${uname}" -R /var/log/rustdesk/ +sudo chown "${uname}" -R /var/log/rustdesk-server/ # Setup Systemd to launch hbbs rustdeskhbbs="$(cat << EOF @@ -164,8 +164,8 @@ WorkingDirectory=/var/lib/rustdesk-server/ User=${uname} Group=${uname} Restart=always -StandardOutput=append:/var/log/rustdesk/rustdeskhbbs.log -StandardError=append:/var/log/rustdesk/rustdeskhbbs.error +StandardOutput=append:/var/log/rustdesk-server/rustdeskhbbs.log +StandardError=append:/var/log/rustdesk-server/rustdeskhbbs.error # Restart service after 10 seconds if node service crashes RestartSec=10 [Install] @@ -189,8 +189,8 @@ WorkingDirectory=/var/lib/rustdesk-server/ User=${uname} Group=${uname} Restart=always -StandardOutput=append:/var/log/rustdesk/rustdeskhbbr.log -StandardError=append:/var/log/rustdesk/rustdeskhbbr.error +StandardOutput=append:/var/log/rustdesk-server/rustdeskhbbr.log +StandardError=append:/var/log/rustdesk-server/rustdeskhbbr.error # Restart service after 10 seconds if node service crashes RestartSec=10 [Install] From a61ef17ff2d391156179f4d9508de0749d973c00 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Wed, 5 Jul 2023 09:22:32 +0100 Subject: [PATCH 10/17] Update install.sh --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 40171f5..6256efc 100644 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ # This script will do the following to install RustDesk Pro # 1. Install some dependencys # 2. Setup ufw firewall if available -# 3. Create a Folder /var/lib/rustdesk-server +# 3. Create 2 Folders /var/lib/rustdesk-server and /var/log/rustdesk-server # 4. Download and extract RustDesk Pro Services to the above folder # 5. Create systemd services for hbbs and hbbr # 6. If you chose Domain, it will install Nginx and certbot, allowing the API to be available on port 443 (https) and get an SSL certificate over port 80, this will autorenew. From 0e5dc2724e13f18a9a39d742bf05456d43f6f7b9 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Wed, 5 Jul 2023 22:45:12 +0100 Subject: [PATCH 11/17] Update convertfromos.sh --- convertfromos.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/convertfromos.sh b/convertfromos.sh index 489cc16..43f99f4 100644 --- a/convertfromos.sh +++ b/convertfromos.sh @@ -1,8 +1,8 @@ #!/bin/bash -# This script will do the following to install RustDesk Pro replacing RustDesk Opensource +# This script will do the following to install RustDesk Server Pro replacing RustDesk Server Opensource # 1. Disable and removes the old services -# 2. Install some dependencys +# 2. Install some dependencies # 3. Setup ufw firewall if available # 4. Create a Folder /var/lib/rustdesk-server and copy the certs here # 5. Download and extract RustDesk Pro Services to the above folder @@ -180,8 +180,8 @@ WorkingDirectory=/var/lib/rustdesk-server/ User=${uname} Group=${uname} Restart=always -StandardOutput=append:/var/log/rustdesk-server/rustdeskhbbs.log -StandardError=append:/var/log/rustdesk-server/rustdeskhbbs.error +StandardOutput=append:/var/log/rustdesk-server/hbbs.log +StandardError=append:/var/log/rustdesk-server/hbbs.error # Restart service after 10 seconds if node service crashes RestartSec=10 [Install] @@ -205,8 +205,8 @@ WorkingDirectory=/var/lib/rustdesk-server/ User=${uname} Group=${uname} Restart=always -StandardOutput=append:/var/log/rustdesk-server/rustdeskhbbr.log -StandardError=append:/var/log/rustdesk-server/rustdeskhbbr.error +StandardOutput=append:/var/log/rustdesk-server/hbbr.log +StandardError=append:/var/log/rustdesk-server/hbbr.error # Restart service after 10 seconds if node service crashes RestartSec=10 [Install] From 7890277f2c1af69acbfa5ec308cae00b04ab1da0 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Wed, 5 Jul 2023 22:46:01 +0100 Subject: [PATCH 12/17] Update install.sh --- install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 6256efc..bba1980 100644 --- a/install.sh +++ b/install.sh @@ -1,7 +1,7 @@ #!/bin/bash -# This script will do the following to install RustDesk Pro -# 1. Install some dependencys +# This script will do the following to install RustDesk Server Pro +# 1. Install some dependencies # 2. Setup ufw firewall if available # 3. Create 2 Folders /var/lib/rustdesk-server and /var/log/rustdesk-server # 4. Download and extract RustDesk Pro Services to the above folder @@ -164,8 +164,8 @@ WorkingDirectory=/var/lib/rustdesk-server/ User=${uname} Group=${uname} Restart=always -StandardOutput=append:/var/log/rustdesk-server/rustdeskhbbs.log -StandardError=append:/var/log/rustdesk-server/rustdeskhbbs.error +StandardOutput=append:/var/log/rustdesk-server/hbbs.log +StandardError=append:/var/log/rustdesk-server/hbbs.error # Restart service after 10 seconds if node service crashes RestartSec=10 [Install] @@ -189,8 +189,8 @@ WorkingDirectory=/var/lib/rustdesk-server/ User=${uname} Group=${uname} Restart=always -StandardOutput=append:/var/log/rustdesk-server/rustdeskhbbr.log -StandardError=append:/var/log/rustdesk-server/rustdeskhbbr.error +StandardOutput=append:/var/log/rustdesk-server/hbbr.log +StandardError=append:/var/log/rustdesk-server/hbbr.error # Restart service after 10 seconds if node service crashes RestartSec=10 [Install] From 6125cc59d14ef3bc227da5a689e28a9f2e9cb6fe Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Wed, 5 Jul 2023 22:52:08 +0100 Subject: [PATCH 13/17] Update install.sh --- install.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index bba1980..6d30f8e 100644 --- a/install.sh +++ b/install.sh @@ -172,10 +172,10 @@ RestartSec=10 WantedBy=multi-user.target EOF )" -echo "${rustdeskhbbs}" | sudo tee /etc/systemd/system/rustdeskhbbs.service > /dev/null +echo "${rustdeskhbbs}" | sudo tee /etc/systemd/system/rustdesk-hbbs.service > /dev/null sudo systemctl daemon-reload -sudo systemctl enable rustdeskhbbs.service -sudo systemctl start rustdeskhbbs.service +sudo systemctl enable rustdesk-hbbs.service +sudo systemctl start rustdesk-hbbs.service # Setup Systemd to launch hbbr rustdeskhbbr="$(cat << EOF @@ -197,13 +197,13 @@ RestartSec=10 WantedBy=multi-user.target EOF )" -echo "${rustdeskhbbr}" | sudo tee /etc/systemd/system/rustdeskhbbr.service > /dev/null +echo "${rustdeskhbbr}" | sudo tee /etc/systemd/system/rustdesk-hbbr.service > /dev/null sudo systemctl daemon-reload -sudo systemctl enable rustdeskhbbr.service -sudo systemctl start rustdeskhbbr.service +sudo systemctl enable rustdesk-hbbr.service +sudo systemctl start rustdesk-hbbr.service while ! [[ $CHECK_RUSTDESK_READY ]]; do - CHECK_RUSTDESK_READY=$(sudo systemctl status rustdeskhbbr.service | grep "Active: active (running)") + CHECK_RUSTDESK_READY=$(sudo systemctl status rustdesk-hbbr.service | grep "Active: active (running)") echo -ne "Rustdesk Relay not ready yet...${NC}\n" sleep 3 done From 8a2a09ea7942e6011d535d53a18a2f231915c830 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Wed, 5 Jul 2023 22:52:44 +0100 Subject: [PATCH 14/17] Update update.sh --- update.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/update.sh b/update.sh index c50cf65..bca0f80 100644 --- a/update.sh +++ b/update.sh @@ -12,8 +12,8 @@ if [ $RDLATEST == $RDCURRENT ]; then exit 0 fi -sudo systemctl stop rustdeskhbbs.service -sudo systemctl stop rustdeskhbbr.service +sudo systemctl stop rustdesk-hbbs.service +sudo systemctl stop rustdesk-hbbr.service sleep 20 ARCH=$(uname -m) @@ -107,11 +107,11 @@ fi sudo chmod +x /usr/bin/hbbs sudo chmod +x /usr/bin/hbbr -sudo systemctl start rustdeskhbbs.service -sudo systemctl start rustdeskhbbr.service +sudo systemctl start rustdesk-hbbs.service +sudo systemctl start rustdesk-hbbr.service while ! [[ $CHECK_RUSTDESK_READY ]]; do - CHECK_RUSTDESK_READY=$(sudo systemctl status rustdeskhbbr.service | grep "Active: active (running)") + CHECK_RUSTDESK_READY=$(sudo systemctl status rustdesk-hbbr.service | grep "Active: active (running)") echo -ne "Rustdesk Relay not ready yet...${NC}\n" sleep 3 done From 70ebaa2190e83aa6bcb06a10edbc500c52ea9c3c Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Wed, 5 Jul 2023 22:54:04 +0100 Subject: [PATCH 15/17] Update convertfromos.sh --- convertfromos.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/convertfromos.sh b/convertfromos.sh index 43f99f4..7d13be1 100644 --- a/convertfromos.sh +++ b/convertfromos.sh @@ -188,10 +188,10 @@ RestartSec=10 WantedBy=multi-user.target EOF )" -echo "${rustdeskhbbs}" | sudo tee /etc/systemd/system/rustdeskhbbs.service > /dev/null +echo "${rustdeskhbbs}" | sudo tee /etc/systemd/system/rustdesk-hbbs.service > /dev/null sudo systemctl daemon-reload -sudo systemctl enable rustdeskhbbs.service -sudo systemctl start rustdeskhbbs.service +sudo systemctl enable rustdesk-hbbs.service +sudo systemctl start rustdesk-hbbs.service # Setup Systemd to launch hbbr rustdeskhbbr="$(cat << EOF @@ -213,13 +213,13 @@ RestartSec=10 WantedBy=multi-user.target EOF )" -echo "${rustdeskhbbr}" | sudo tee /etc/systemd/system/rustdeskhbbr.service > /dev/null +echo "${rustdeskhbbr}" | sudo tee /etc/systemd/system/rustdesk-hbbr.service > /dev/null sudo systemctl daemon-reload -sudo systemctl enable rustdeskhbbr.service -sudo systemctl start rustdeskhbbr.service +sudo systemctl enable rustdesk-hbbr.service +sudo systemctl start rustdesk-hbbr.service while ! [[ $CHECK_RUSTDESK_READY ]]; do - CHECK_RUSTDESK_READY=$(sudo systemctl status rustdeskhbbr.service | grep "Active: active (running)") + CHECK_RUSTDESK_READY=$(sudo systemctl status rustdesk-hbbr.service | grep "Active: active (running)") echo -ne "Rustdesk Relay not ready yet...${NC}\n" sleep 3 done From 3206736727b9c5d55636dbb81212ca67ba07d4f2 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Wed, 5 Jul 2023 23:14:57 +0100 Subject: [PATCH 16/17] Create install2.sh --- install2.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 install2.sh diff --git a/install2.sh b/install2.sh new file mode 100644 index 0000000..f0eb6c6 --- /dev/null +++ b/install2.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +wget https://raw.githubusercontent.com/dinger1986/rustdesk-server-pro/main/install.sh + +chmod +x install.sh + +./install.sh From 175171111755b7ca1374adf6aa7b37b0b43ad76b Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Wed, 5 Jul 2023 23:35:53 +0100 Subject: [PATCH 17/17] Delete install2.sh --- install2.sh | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 install2.sh diff --git a/install2.sh b/install2.sh deleted file mode 100644 index f0eb6c6..0000000 --- a/install2.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -wget https://raw.githubusercontent.com/dinger1986/rustdesk-server-pro/main/install.sh - -chmod +x install.sh - -./install.sh