mirror of
https://github.com/techahold/rustdeskinstall.git
synced 2024-07-04 11:36:05 +02:00
A few suggestions that might
help improve/extend OS detection/support install more of the dependencies - curl and wget were missing
This commit is contained in:
parent
59ee76784a
commit
4f9c175355
93
install.sh
93
install.sh
|
@ -17,26 +17,95 @@ break
|
||||||
"DNS/Domain")
|
"DNS/Domain")
|
||||||
echo -ne "Enter your preferred domain/dns address ${NC}: "
|
echo -ne "Enter your preferred domain/dns address ${NC}: "
|
||||||
read wanip
|
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
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
*) echo "invalid option $REPLY";;
|
*) echo "invalid option $REPLY";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# Setup prereqs for server
|
# identify OS
|
||||||
if [[ $(which yum) ]]; then
|
if [ -f /etc/os-release ]; then
|
||||||
sudo yum install unzip -y
|
# freedesktop.org and systemd
|
||||||
sudo yum install bind-utils -y
|
. /etc/os-release
|
||||||
sudo yum install tar -y
|
OS=$NAME
|
||||||
elif [[ $(which apt) ]]; then
|
VER=$VERSION_ID
|
||||||
sudo apt-get update
|
IDLIKE=$ID_LIKE
|
||||||
sudo apt-get install unzip -y
|
elif type lsb_release >/dev/null 2>&1; then
|
||||||
sudo apt-get install dnsutils -y
|
# linuxbase.org
|
||||||
sudo apt-get install tar -y
|
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
|
else
|
||||||
echo "Unknown Platform, the install might fail"
|
# Fall back to uname, e.g. "Linux <version>", also works for BSD, etc.
|
||||||
|
OS=$(uname -s)
|
||||||
|
VER=$(uname -r)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Setup prereqs for server
|
||||||
|
# common named prereqs
|
||||||
|
prereq="curl wget unzip tar"
|
||||||
|
echo "Installing prerequisites"
|
||||||
|
if [ "$OS" = "Ubuntu" ] || [ "$OS" = "Debian" ]; then
|
||||||
|
prereq+=" dnsutils"
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y "${prereq}" # git
|
||||||
|
elif [ "$OS" = "CentOS" ] || [ "$OS" = "RedHat" ]; then
|
||||||
|
prereq+=" bind-utils"
|
||||||
|
yum update -y
|
||||||
|
yum install -y "${prereq}" # git
|
||||||
|
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
|
||||||
|
|
||||||
|
# #/*
|
||||||
|
# Alternatively since case is faster than if then else
|
||||||
|
# case ${IDLIKE} in
|
||||||
|
# ubuntu|debian)
|
||||||
|
# # Debian/Ubuntu/etc.
|
||||||
|
# sudo apt-get update
|
||||||
|
# sudo apt-get install -y curl wget unzip dnsutils tar # git
|
||||||
|
# ;;
|
||||||
|
# centos|fedora|redhat) #|amazon)
|
||||||
|
# # CentOS/RedHat/Fedora/Amazon/etc.
|
||||||
|
# sudo yum update -y
|
||||||
|
# sudo yum install -y curl wget unzip bind-utils tar # git
|
||||||
|
# ;;
|
||||||
|
# *)
|
||||||
|
# echo "Unsupported OS"
|
||||||
|
# echo "Unknown Platform, the install might fail"
|
||||||
|
# # 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
|
||||||
|
# ;;
|
||||||
|
# esac
|
||||||
|
# */
|
||||||
|
|
||||||
# Make Folder /opt/rustdesk/
|
# Make Folder /opt/rustdesk/
|
||||||
if [ ! -d "/opt/rustdesk" ]; then
|
if [ ! -d "/opt/rustdesk" ]; then
|
||||||
echo "Creating /opt/rustdesk"
|
echo "Creating /opt/rustdesk"
|
||||||
|
@ -116,7 +185,7 @@ done
|
||||||
pubname=$(find /opt/rustdesk -name *.pub)
|
pubname=$(find /opt/rustdesk -name *.pub)
|
||||||
key=$(cat "${pubname}")
|
key=$(cat "${pubname}")
|
||||||
|
|
||||||
sudo rm rustdesk-server-linux-x64.zip
|
rm rustdesk-server-linux-x64.zip
|
||||||
|
|
||||||
# Create windows install script
|
# Create windows install script
|
||||||
wget https://raw.githubusercontent.com/dinger1986/rustdeskinstall/master/WindowsAgentAIOInstall.ps1
|
wget https://raw.githubusercontent.com/dinger1986/rustdeskinstall/master/WindowsAgentAIOInstall.ps1
|
||||||
|
|
|
@ -3,17 +3,60 @@
|
||||||
uname=$(whoami)
|
uname=$(whoami)
|
||||||
admintoken=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c8)
|
admintoken=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c8)
|
||||||
|
|
||||||
|
|
||||||
|
# identify OS
|
||||||
|
if [ -f /etc/os-release ]; then
|
||||||
|
# freedesktop.org and systemd
|
||||||
|
. /etc/os-release
|
||||||
|
OS=$NAME
|
||||||
|
VER=$VERSION_ID
|
||||||
|
IDLIKE=$ID_LIKE
|
||||||
|
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)
|
||||||
|
|
||||||
# Install Rustdesk
|
# Install Rustdesk
|
||||||
if [[ $(which yum) ]]; then
|
case ${OS,,} in
|
||||||
wget https://github.com/rustdesk/rustdesk/releases/download/1.1.9/rustdesk-1.1.9.rpm
|
# or case ${IDLIKE,,} in .. to support derivatives
|
||||||
sudo yum localinstall ./rustdesk-1.1.9.rpm
|
ubuntu|debian)
|
||||||
elif [[ $(which apt) ]]; then
|
# Debian/Ubuntu/etc.
|
||||||
wget https://github.com/rustdesk/rustdesk/releases/download/1.1.9/rustdesk-1.1.9.deb
|
wget https://github.com/rustdesk/rustdesk/releases/download/1.1.9/rustdesk-1.1.9.deb
|
||||||
sudo apt install -fy ./rustdesk-1.1.9.deb
|
sudo apt install -fy ./rustdesk-1.1.9.deb
|
||||||
else
|
;;
|
||||||
echo "Unknown Platform, the install will fail"
|
fedora|centos|redhat|amazon)
|
||||||
exit
|
# Red Hat, CentOS, etc.
|
||||||
fi
|
|
||||||
|
wget https://github.com/rustdesk/rustdesk/releases/download/1.1.9/rustdesk-1.1.9.rpm
|
||||||
|
sudo yum localinstall ./rustdesk-1.1.9.rpm
|
||||||
|
# sudo dnf install -y ./rustdesk-1.1.9.rpm
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported OS"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
rustdesk --password ${admintoken}
|
rustdesk --password ${admintoken}
|
||||||
pkill -f "rustdesk"
|
pkill -f "rustdesk"
|
||||||
|
|
60
update.sh
60
update.sh
|
@ -8,16 +8,58 @@ sudo systemctl stop rustdesksignal.service
|
||||||
sudo systemctl stop rustdeskrelay.service
|
sudo systemctl stop rustdeskrelay.service
|
||||||
|
|
||||||
|
|
||||||
# Setup prereqs for server
|
# identify OS
|
||||||
if [[ $(which yum) ]]; then
|
if [ -f /etc/os-release ]; then
|
||||||
sudo yum install unzip -y
|
# freedesktop.org and systemd
|
||||||
sudo yum install bind-utils -y
|
. /etc/os-release
|
||||||
elif [[ $(which apt) ]]; then
|
OS=$NAME
|
||||||
sudo apt-get update
|
VER=$VERSION_ID
|
||||||
sudo apt-get install unzip -y
|
IDLIKE=$ID_LIKE
|
||||||
sudo apt-get install dnsutils -y
|
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
|
else
|
||||||
echo "Unknown Platform, the install might fail"
|
# Fall back to uname, e.g. "Linux <version>", also works for BSD, etc.
|
||||||
|
OS=$(uname -s)
|
||||||
|
VER=$(uname -r)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Setup prereqs for server
|
||||||
|
# common named prereqs
|
||||||
|
prereq="curl wget unzip tar"
|
||||||
|
echo "Installing prerequisites"
|
||||||
|
if [ "$OS" = "Ubuntu" ] || [ "$OS" = "Debian" ]; then
|
||||||
|
prereq+=" dnsutils"
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y "${prereq}" # git
|
||||||
|
elif [ "$OS" = "CentOS" ] || [ "$OS" = "RedHat" ]; then
|
||||||
|
prereq+=" bind-utils"
|
||||||
|
yum update -y
|
||||||
|
yum install -y "${prereq}" # git
|
||||||
|
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
|
fi
|
||||||
|
|
||||||
cd /opt/rustdesk/
|
cd /opt/rustdesk/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user