Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be3fab3a52 | ||
|
|
7ae3739716 | ||
|
|
707854675e | ||
|
|
d8f29f5aeb | ||
|
|
aabf85921e | ||
|
|
d7ad8d2f70 | ||
|
|
be6b1e66a1 | ||
|
|
abfd7c9ab1 | ||
|
|
a55e515e04 | ||
|
|
74ecae9fb3 | ||
|
|
2e0edd77ef | ||
|
|
7e178c4738 | ||
|
|
2ade8b409d | ||
|
|
9ca9a54d10 | ||
|
|
72304f95bb | ||
|
|
cde1a2e77a | ||
|
|
b4ab33f25d | ||
|
|
50781866b9 | ||
|
|
75b8f67d83 | ||
|
|
cce8bbbbee | ||
|
|
a70cd79e36 | ||
|
|
1c46003561 | ||
|
|
2e0fe1ffd5 | ||
|
|
145c9a8e2f | ||
|
|
b6241ab778 | ||
|
|
f17b99e6cc | ||
|
|
2b4889f61c | ||
|
|
53c97910c3 | ||
|
|
e7c54cc7fc | ||
|
|
82736dbfc6 | ||
|
|
1826725246 | ||
|
|
d8a3b7340c | ||
|
|
ab88536f56 | ||
|
|
c6c6cc2949 | ||
|
|
1cea6ac412 | ||
|
|
6a7e38788a | ||
|
|
e382b55c07 | ||
|
|
11ef6f1c53 | ||
|
|
90e75caf15 |
153
backup.sh
Normal file
153
backup.sh
Normal file
@@ -0,0 +1,153 @@
|
||||
#!/usr/bin/env bash
|
||||
usern=$(whoami)
|
||||
path=$(pwd)
|
||||
echo $path
|
||||
|
||||
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 <version>", also works for BSD, etc.
|
||||
OS=$(uname -s)
|
||||
VER=$(uname -r)
|
||||
fi
|
||||
|
||||
|
||||
# Output debugging 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="tar"
|
||||
PREREQDEB="sqlite3"
|
||||
PREREQRPM="sqlite"
|
||||
PREREQARCH="sqlite"
|
||||
|
||||
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 dnf install -y epel-release
|
||||
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
|
||||
|
||||
if [[ $* == *--schedule* ]]; then
|
||||
(
|
||||
crontab -l 2>/dev/null
|
||||
echo "0 0 * * * $path/backup.sh --auto"
|
||||
) | crontab -
|
||||
|
||||
if [ ! -d /opt/rustdesk-server-backups ]; then
|
||||
sudo mkdir /opt/rustdesk-server-backups
|
||||
fi
|
||||
|
||||
if [ ! -d /opt/rustdesk-server-backups/daily ]; then
|
||||
sudo mkdir /opt/rustdesk-server-backups/daily
|
||||
fi
|
||||
|
||||
if [ ! -d /opt/rustdesk-server-backups/weekly ]; then
|
||||
sudo mkdir /opt/rustdesk-server-backups/weekly
|
||||
fi
|
||||
|
||||
if [ ! -d /opt/rustdesk-server-backups/monthly ]; then
|
||||
sudo mkdir /opt/rustdesk-server-backups/monthly
|
||||
fi
|
||||
sudo chown ${usern}:${usern} -R /opt/rustdesk-server-backups
|
||||
|
||||
printf >&2 "Backups setup to run at midnight and rotate."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -d /opt/rustdesk-server-backups ]; then
|
||||
sudo mkdir /opt/rustdesk-server-backups
|
||||
sudo chown ${usern}:${usern} /opt/rustdesk-server-backups
|
||||
fi
|
||||
|
||||
dt_now=$(date '+%Y_%m_%d__%H_%M_%S')
|
||||
tmp_dir=$(mktemp -d -t rustdesk-XXXXXXXXXXXXXXXXXXXXX)
|
||||
sysd="/etc/systemd/system"
|
||||
|
||||
cp -rf /var/lib/rustdesk-server/ ${tmp_dir}/
|
||||
sqlite3 /var/lib/rustdesk-server/db.sqlite3 .dump > ${tmp_dir}/db_backup_file.sql
|
||||
|
||||
if [[ $* == *--auto* ]]; then
|
||||
|
||||
month_day=$(date +"%d")
|
||||
week_day=$(date +"%u")
|
||||
|
||||
if [ "$month_day" -eq 10 ]; then
|
||||
tar -cf /opt/rustdesk-server-backups/monthly/rustdesk-backup-${dt_now}.tar -C ${tmp_dir} .
|
||||
else
|
||||
if [ "$week_day" -eq 5 ]; then
|
||||
tar -cf /opt/rustdesk-server-backups/weekly/rustdesk-backup-${dt_now}.tar -C ${tmp_dir} .
|
||||
else
|
||||
tar -cf /opt/rustdesk-server-backups/daily/rustdesk-backup-${dt_now}.tar -C ${tmp_dir} .
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf ${tmp_dir}
|
||||
|
||||
find /opt/rustdesk-server-backups/daily/ -type f -mtime +14 -name '*.tar' -execdir rm -- '{}' \;
|
||||
find /opt/rustdesk-server-backups/weekly/ -type f -mtime +60 -name '*.tar' -execdir rm -- '{}' \;
|
||||
find /opt/rustdesk-server-backups/monthly/ -type f -mtime +380 -name '*.tar' -execdir rm -- '{}' \;
|
||||
echo -ne "Backup Completed"
|
||||
exit
|
||||
|
||||
else
|
||||
tar -cf /opt/rustdesk-server-backups/rustdesk-backup-${dt_now}.tar -C ${tmp_dir} .
|
||||
rm -rf ${tmp_dir}
|
||||
echo -ne "Backup saved to /opt/rustdesk-server-backups/rustdesk-backup-${dt_now}.tar"
|
||||
fi
|
||||
@@ -10,7 +10,7 @@
|
||||
# 7. If you choose 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, it is automatically renewed
|
||||
|
||||
# Get username
|
||||
uname=$(whoami)
|
||||
usern=$(whoami)
|
||||
admintoken=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c16)
|
||||
|
||||
sudo systemctl stop gohttpserver.service
|
||||
@@ -87,7 +87,7 @@ 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
|
||||
elif [ "$OS" = "CentOS" ] || [ "$OS" = "RedHat" ] || [ "${UPSTREAM_ID}" = "rhel" ] || [ "${OS}" = "Almalinux" ] || [ "${UPSTREAM_ID}" = "Rocky*" ] ; 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" ]
|
||||
@@ -116,7 +116,7 @@ if [ ! -d "/var/lib/rustdesk-server" ]; then
|
||||
sudo mkdir -p /var/lib/rustdesk-server/
|
||||
fi
|
||||
|
||||
sudo chown "${uname}" -R /var/lib/rustdesk-server
|
||||
sudo chown "${usern}" -R /var/lib/rustdesk-server
|
||||
cd /var/lib/rustdesk-server/ || exit 1
|
||||
|
||||
mv /opt/rustdesk/id_* /var/lib/rustdesk-server/
|
||||
@@ -126,31 +126,31 @@ 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) }')
|
||||
|
||||
echo "Installing RustDesk Server"
|
||||
echo "Installing RustDesk Server Pro"
|
||||
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
|
||||
wget https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-amd64.tar.gz
|
||||
tar -xf rustdesk-server-linux-amd64.tar.gz
|
||||
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
|
||||
rm -rf rustdesk-server-linux-amd64.tar.gz
|
||||
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
|
||||
wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-armv7.tar.gz"
|
||||
tar -xf rustdesk-server-linux-armv7.tar.gz
|
||||
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
|
||||
rm -rf rustdesk-server-linux-armv7.tar.gz
|
||||
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
|
||||
wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-arm64v8.tar.gz"
|
||||
tar -xf rustdesk-server-linux-arm64v8.tar.gz
|
||||
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
|
||||
rm -rf rustdesk-server-linux-arm64v8.tar.gz
|
||||
fi
|
||||
|
||||
sudo chmod +x /usr/bin/hbbs
|
||||
@@ -162,7 +162,7 @@ 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-server/
|
||||
sudo chown "${usern}" -R /var/log/rustdesk-server/
|
||||
sudo rm -rf /var/log/rustdesk/
|
||||
|
||||
# Setup systemd to launch hbbs
|
||||
@@ -174,8 +174,8 @@ Type=simple
|
||||
LimitNOFILE=1000000
|
||||
ExecStart=/usr/bin/hbbs
|
||||
WorkingDirectory=/var/lib/rustdesk-server/
|
||||
User=${uname}
|
||||
Group=${uname}
|
||||
User=${usern}
|
||||
Group=${usern}
|
||||
Restart=always
|
||||
StandardOutput=append:/var/log/rustdesk-server/hbbs.log
|
||||
StandardError=append:/var/log/rustdesk-server/hbbs.error
|
||||
@@ -199,8 +199,8 @@ Type=simple
|
||||
LimitNOFILE=1000000
|
||||
ExecStart=/usr/bin/hbbr
|
||||
WorkingDirectory=/var/lib/rustdesk-server/
|
||||
User=${uname}
|
||||
Group=${uname}
|
||||
User=${usern}
|
||||
Group=${usern}
|
||||
Restart=always
|
||||
StandardOutput=append:/var/log/rustdesk-server/hbbr.log
|
||||
StandardError=append:/var/log/rustdesk-server/hbbr.error
|
||||
@@ -226,13 +226,13 @@ key=$(cat "${pubname}")
|
||||
|
||||
echo "Tidying up install"
|
||||
if [ "${ARCH}" = "x86_64" ] ; then
|
||||
rm rustdesk-server-linux-amd64.zip
|
||||
rm rustdesk-server-linux-amd64.tar.gz
|
||||
rm -rf amd64
|
||||
elif [ "${ARCH}" = "armv7l" ] ; then
|
||||
rm rustdesk-server-linux-armv7.zip
|
||||
rm rustdesk-server-linux-armv7.tar.gz
|
||||
rm -rf armv7
|
||||
elif [ "${ARCH}" = "aarch64" ] ; then
|
||||
rm rustdesk-server-linux-arm64v8.zip
|
||||
rm rustdesk-server-linux-arm64v8.tar.gz
|
||||
rm -rf arm64v8
|
||||
fi
|
||||
|
||||
@@ -257,8 +257,27 @@ 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
|
||||
|
||||
echo "Installing nginx"
|
||||
if [ "${ID}" = "debian" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Debian" ] || [ "${UPSTREAM_ID}" = "ubuntu" ] || [ "${UPSTREAM_ID}" = "debian" ]; then
|
||||
sudo apt -y install nginx
|
||||
sudo apt -y install python3-certbot-nginx
|
||||
elif [ "$OS" = "CentOS" ] || [ "$OS" = "RedHat" ] || [ "${UPSTREAM_ID}" = "rhel" ] || [ "${OS}" = "Almalinux" ] || [ "${UPSTREAM_ID}" = "Rocky*" ] ; 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 -y install nginx
|
||||
sudo yum -y install python3-certbot-nginx
|
||||
elif [ "${ID}" = "arch" ] || [ "${UPSTREAM_ID}" = "arch" ]; then
|
||||
sudo pacman -S install nginx
|
||||
sudo pacman -S install python3-certbot-nginx
|
||||
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
|
||||
|
||||
rustdesknginx="$(
|
||||
cat <<EOF
|
||||
|
||||
57
install.sh
57
install.sh
@@ -9,7 +9,7 @@
|
||||
# 6. If you choose 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, it is automatically renewed
|
||||
|
||||
# Get username
|
||||
uname=$(whoami)
|
||||
usern=$(whoami)
|
||||
admintoken=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c16)
|
||||
|
||||
ARCH=$(uname -m)
|
||||
@@ -75,7 +75,7 @@ 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
|
||||
elif [ "$OS" = "CentOS" ] || [ "$OS" = "RedHat" ] || [ "${UPSTREAM_ID}" = "rhel" ] || [ "${OS}" = "Almalinux" ] || [ "${UPSTREAM_ID}" = "Rocky*" ] ; 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" ]
|
||||
@@ -104,7 +104,7 @@ if [ ! -d "/var/lib/rustdesk-server" ]; then
|
||||
sudo mkdir -p /var/lib/rustdesk-server/
|
||||
fi
|
||||
|
||||
sudo chown "${uname}" -R /var/lib/rustdesk-server
|
||||
sudo chown "${usern}" -R /var/lib/rustdesk-server
|
||||
cd /var/lib/rustdesk-server/ || exit 1
|
||||
|
||||
|
||||
@@ -113,29 +113,29 @@ RDLATEST=$(curl https://api.github.com/repos/rustdesk/rustdesk-server-pro/releas
|
||||
|
||||
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
|
||||
wget https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-amd64.tar.gz
|
||||
tar -xf rustdesk-server-linux-amd64.tar.gz
|
||||
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
|
||||
rm -rf rustdesk-server-linux-amd64.tar.gz
|
||||
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
|
||||
wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-armv7.tar.gz"
|
||||
tar -xf rustdesk-server-linux-armv7.tar.gz
|
||||
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
|
||||
rm -rf rustdesk-server-linux-armv7.tar.gz
|
||||
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
|
||||
wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-arm64v8.tar.gz"
|
||||
tar -xf rustdesk-server-linux-arm64v8.tar.gz
|
||||
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
|
||||
rm -rf rustdesk-server-linux-arm64v8.tar.gz
|
||||
fi
|
||||
|
||||
sudo chmod +x /usr/bin/hbbs
|
||||
@@ -147,7 +147,7 @@ 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-server/
|
||||
sudo chown "${usern}" -R /var/log/rustdesk-server/
|
||||
|
||||
# Setup systemd to launch hbbs
|
||||
rustdeskhbbs="$(cat << EOF
|
||||
@@ -158,8 +158,8 @@ Type=simple
|
||||
LimitNOFILE=1000000
|
||||
ExecStart=/usr/bin/hbbs
|
||||
WorkingDirectory=/var/lib/rustdesk-server/
|
||||
User=${uname}
|
||||
Group=${uname}
|
||||
User=${usern}
|
||||
Group=${usern}
|
||||
Restart=always
|
||||
StandardOutput=append:/var/log/rustdesk-server/hbbs.log
|
||||
StandardError=append:/var/log/rustdesk-server/hbbs.error
|
||||
@@ -183,8 +183,8 @@ Type=simple
|
||||
LimitNOFILE=1000000
|
||||
ExecStart=/usr/bin/hbbr
|
||||
WorkingDirectory=/var/lib/rustdesk-server/
|
||||
User=${uname}
|
||||
Group=${uname}
|
||||
User=${usern}
|
||||
Group=${usern}
|
||||
Restart=always
|
||||
StandardOutput=append:/var/log/rustdesk-server/hbbr.log
|
||||
StandardError=append:/var/log/rustdesk-server/hbbr.error
|
||||
@@ -241,8 +241,27 @@ 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
|
||||
|
||||
echo "Installing nginx"
|
||||
if [ "${ID}" = "debian" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Debian" ] || [ "${UPSTREAM_ID}" = "ubuntu" ] || [ "${UPSTREAM_ID}" = "debian" ]; then
|
||||
sudo apt -y install nginx
|
||||
sudo apt -y install python3-certbot-nginx
|
||||
elif [ "$OS" = "CentOS" ] || [ "$OS" = "RedHat" ] || [ "${UPSTREAM_ID}" = "rhel" ] || [ "${OS}" = "Almalinux" ] || [ "${UPSTREAM_ID}" = "Rocky*" ] ; 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 -y install nginx
|
||||
sudo yum -y install python3-certbot-nginx
|
||||
elif [ "${ID}" = "arch" ] || [ "${UPSTREAM_ID}" = "arch" ]; then
|
||||
sudo pacman -S install nginx
|
||||
sudo pacman -S install python3-certbot-nginx
|
||||
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
|
||||
|
||||
rustdesknginx="$(
|
||||
cat <<EOF
|
||||
|
||||
294
restore.sh
Normal file
294
restore.sh
Normal file
@@ -0,0 +1,294 @@
|
||||
#!/usr/bin/env bash
|
||||
usern=$(whoami)
|
||||
path=$(pwd)
|
||||
echo $path
|
||||
|
||||
# Check for /var/lib/rustdesk-server/
|
||||
if [ -d "/var/lib/rustdesk-server" ]; then
|
||||
echo "Directory already exists so not needing to restore"
|
||||
exit
|
||||
fi
|
||||
|
||||
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 <version>", also works for BSD, etc.
|
||||
OS=$(uname -s)
|
||||
VER=$(uname -r)
|
||||
fi
|
||||
|
||||
|
||||
# Output debugging 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 sqlite3"
|
||||
PREREQRPM="bind-utils sqlite"
|
||||
PREREQARCH="bind sqlite"
|
||||
|
||||
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" ] || [ "${OS}" = "Almalinux" ] || [ "${UPSTREAM_ID}" = "Rocky*" ] ; 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 dnf install -y epel-release
|
||||
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
|
||||
|
||||
tmp_dir=$(mktemp -d -t)
|
||||
|
||||
tar -xf $path/*.tar -C $tmp_dir
|
||||
|
||||
cp -rf ${tmp_dir}/rustdesk-server/ /var/lib/
|
||||
sudo chown ${usern}:${usern} -R /var/lib/rustdesk-server/
|
||||
rm /var/lib/rustdesk-server/db.sqlite3
|
||||
sqlite3 /var/lib/rustdesk-server/db.sqlite3 < ${tmp_dir}/db_backup_file.sql
|
||||
|
||||
# Get current release version
|
||||
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) }' | sed 's/-.*//')
|
||||
|
||||
cd /var/lib/rustdesk-server/
|
||||
rm -rf static/
|
||||
|
||||
echo "Installing RustDesk Server"
|
||||
if [ "${ARCH}" = "x86_64" ] ; then
|
||||
wget https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-amd64.tar.gz
|
||||
tar -xf rustdesk-server-linux-amd64.tar.gz
|
||||
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.tar.gz
|
||||
elif [ "${ARCH}" = "armv7l" ] ; then
|
||||
wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-armv7.tar.gz"
|
||||
tar -xf rustdesk-server-linux-armv7.tar.gz
|
||||
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.tar.gz
|
||||
elif [ "${ARCH}" = "aarch64" ] ; then
|
||||
wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-arm64v8.tar.gz"
|
||||
tar -xf rustdesk-server-linux-arm64v8.tar.gz
|
||||
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.tar.gz
|
||||
fi
|
||||
|
||||
sudo chmod +x /usr/bin/hbbs
|
||||
sudo chmod +x /usr/bin/hbbr
|
||||
|
||||
# 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 "${usern}" -R /var/log/rustdesk-server/
|
||||
|
||||
# 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=${usern}
|
||||
Group=${usern}
|
||||
Restart=always
|
||||
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]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
)"
|
||||
echo "${rustdeskhbbs}" | sudo tee /etc/systemd/system/rustdesk-hbbs.service > /dev/null
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable rustdesk-hbbs.service
|
||||
sudo systemctl start rustdesk-hbbs.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=${usern}
|
||||
Group=${usern}
|
||||
Restart=always
|
||||
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]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
)"
|
||||
echo "${rustdeskhbbr}" | sudo tee /etc/systemd/system/rustdesk-hbbr.service > /dev/null
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable rustdesk-hbbr.service
|
||||
sudo systemctl start rustdesk-hbbr.service
|
||||
|
||||
while ! [[ $CHECK_RUSTDESK_READY ]]; do
|
||||
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
|
||||
|
||||
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.tar.gz
|
||||
rm -rf amd64
|
||||
elif [ "${ARCH}" = "armv7l" ] ; then
|
||||
rm rustdesk-server-linux-armv7.tar.gz
|
||||
rm -rf armv7
|
||||
elif [ "${ARCH}" = "aarch64" ] ; then
|
||||
rm rustdesk-server-linux-arm64v8.tar.gz
|
||||
rm -rf arm64v8
|
||||
fi
|
||||
|
||||
rm -rf ${tmp_dir}/
|
||||
|
||||
# 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
|
||||
|
||||
echo "Installing nginx"
|
||||
if [ "${ID}" = "debian" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Debian" ] || [ "${UPSTREAM_ID}" = "ubuntu" ] || [ "${UPSTREAM_ID}" = "debian" ]; then
|
||||
sudo apt -y install nginx
|
||||
sudo apt -y install python3-certbot-nginx
|
||||
elif [ "$OS" = "CentOS" ] || [ "$OS" = "RedHat" ] || [ "${UPSTREAM_ID}" = "rhel" ] || [ "${OS}" = "Almalinux" ] || [ "${UPSTREAM_ID}" = "Rocky*" ] ; 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 -y install nginx
|
||||
sudo yum -y install python3-certbot-nginx
|
||||
elif [ "${ID}" = "arch" ] || [ "${UPSTREAM_ID}" = "arch" ]; then
|
||||
sudo pacman -S install nginx
|
||||
sudo pacman -S install python3-certbot-nginx
|
||||
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
|
||||
|
||||
rustdesknginx="$(
|
||||
cat <<EOF
|
||||
server {
|
||||
server_name ${wanip};
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:21114/;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
)"
|
||||
echo "${rustdesknginx}" | sudo tee /etc/nginx/sites-available/rustdesk.conf >/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}"
|
||||
|
||||
echo -e "Restore is complete"
|
||||
45
terms
Normal file
45
terms
Normal file
@@ -0,0 +1,45 @@
|
||||
Purslane Limited Software License Agreement
|
||||
|
||||
IMPORTANT: PLEASE READ THIS SOFTWARE LICENSE AGREEMENT ("LICENSE AGREEMENT") CAREFULLY BEFORE USING THE RustDesk Server Pro SOFTWARE. BY USING THE SOFTWARE, YOU (EITHER AN INDIVIDUAL OR A SINGLE ENTITY) AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE AGREEMENT, DO NOT USE THE SOFTWARE.
|
||||
|
||||
1. License Grant:
|
||||
Subject to the terms and conditions of this License Agreement, Purslane Limited ("Licensor") grants you a non-exclusive, non-transferable license to use the RustDesk Server Pro software ("Software") for your internal business purposes. This license is granted on a per-server (per-machine) basis.
|
||||
|
||||
2 License Restrictions:
|
||||
a) You shall not copy, modify, distribute, sell, lease, sublicense, or transfer the Software or any portion thereof.
|
||||
b) You shall not reverse engineer, decompile, or disassemble the Software, except to the extent expressly permitted by applicable law.
|
||||
c) You shall not remove or alter any proprietary notices or labels on the Software.
|
||||
|
||||
3. License Key:
|
||||
a) Purslane Limited will provide you with a unique license key ("License Key") to activate the Software on a specific server (machine).
|
||||
b) You agree that the License Key provided to you by Purslane Limited will be used exclusively on the designated server (machine) and will not be shared, transferred, or used on any other server (machine) without explicit written permission from Purslane Limited.
|
||||
|
||||
4. Term and Billing:
|
||||
a) The license term for the Software shall be one (1) year, starting from the date of purchase.
|
||||
b) You agree to pay the annual license fee as specified by Licensor. Failure to make timely payments may result in suspension or termination of the license.
|
||||
|
||||
5. Maintenance and Support:
|
||||
a) Support is offered via email.
|
||||
b) During the license term, Licensor may provide maintenance and support services for the Software as separately agreed upon or specified in a separate support agreement.
|
||||
c) Licensor reserves the right to modify or enhance the support services at its sole discretion.
|
||||
|
||||
6. Intellectual Property:
|
||||
a) You acknowledge that the Software and any accompanying documentation are protected by intellectual property laws and treaties.
|
||||
b) You agree not to remove or alter any copyright, trademark, or other proprietary rights notices contained in or on the Software.
|
||||
|
||||
7. Disclaimer of Warranty:
|
||||
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. LICENSOR DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
|
||||
8. Limitation of Liability:
|
||||
IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, CONSEQUENTIAL, OR PUNITIVE DAMAGES ARISING OUT OF OR RELATED TO THIS LICENSE AGREEMENT OR THE USE OF THE SOFTWARE, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
9. Termination:
|
||||
This License Agreement is effective until terminated. Licensor may terminate this License Agreement immediately upon notice to you if you breach any of the terms and conditions. Upon termination, you must cease all use of the Software and destroy all copies in your possession.
|
||||
|
||||
10. Governing Law:
|
||||
This License Agreement shall be governed by and construed in accordance with the laws of The Cayman Islands. Any legal action or proceeding arising under this License Agreement shall be brought exclusively in the courts of The Cayman Islands.
|
||||
|
||||
11. Entire Agreement:
|
||||
This License Agreement shall be governed by and construed in accordance with the laws of the Cayman Islands. Any legal action or proceeding arising under this License Agreement shall be brought exclusively in the courts of the Cayman Islands.
|
||||
|
||||
By using the RustDesk Server Pro software, you acknowledge that you have read and understood this License Agreement and agree to be bound by its terms and conditions.
|
||||
20
update.sh
20
update.sh
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get username
|
||||
uname=$(whoami) # not used btw ... yet
|
||||
usern=$(whoami) # not used btw ... yet
|
||||
|
||||
# Get current release version
|
||||
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) }' | sed 's/-.*//')
|
||||
@@ -81,29 +81,29 @@ rm -rf static/
|
||||
|
||||
echo "Upgrading 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
|
||||
wget https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-amd64.tar.gz
|
||||
tar -xf rustdesk-server-linux-amd64.tar.gz
|
||||
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
|
||||
rm -rf rustdesk-server-linux-amd64.tar.gz
|
||||
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
|
||||
wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-armv7.tar.gz"
|
||||
tar -xf rustdesk-server-linux-armv7.tar.gz
|
||||
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
|
||||
rm -rf rustdesk-server-linux-armv7.tar.gz
|
||||
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
|
||||
wget "https://github.com/rustdesk/rustdesk-server-pro/releases/download/${RDLATEST}/rustdesk-server-linux-arm64v8.tar.gz"
|
||||
tar -xf rustdesk-server-linux-arm64v8.tar.gz
|
||||
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
|
||||
rm -rf rustdesk-server-linux-arm64v8.tar.gz
|
||||
fi
|
||||
|
||||
sudo chmod +x /usr/bin/hbbs
|
||||
|
||||
Reference in New Issue
Block a user