Update rustdesk.sh
This commit is contained in:
parent
55738df2cd
commit
a0904b6fb7
1 changed files with 32 additions and 2 deletions
34
rustdesk.sh
34
rustdesk.sh
|
|
@ -3,6 +3,7 @@
|
||||||
# Variables
|
# Variables
|
||||||
RUSTDESK_URL="https://github.com/rustdesk/rustdesk/releases/download/1.2.3/rustdesk-1.2.3-x86_64.deb"
|
RUSTDESK_URL="https://github.com/rustdesk/rustdesk/releases/download/1.2.3/rustdesk-1.2.3-x86_64.deb"
|
||||||
RUSTDESK_DEB="rustdesk-1.2.3-x86_64.deb"
|
RUSTDESK_DEB="rustdesk-1.2.3-x86_64.deb"
|
||||||
|
ID_SERVER="192.168.1.242"
|
||||||
|
|
||||||
# Check for curl
|
# Check for curl
|
||||||
if ! command -v curl &> /dev/null; then
|
if ! command -v curl &> /dev/null; then
|
||||||
|
|
@ -12,7 +13,7 @@ fi
|
||||||
|
|
||||||
echo "Downloading RustDesk..."
|
echo "Downloading RustDesk..."
|
||||||
|
|
||||||
# Downloading the RustDesk .deb package
|
# Download the RustDesk .deb package
|
||||||
if curl -L "$RUSTDESK_URL" -o "$RUSTDESK_DEB"; then
|
if curl -L "$RUSTDESK_URL" -o "$RUSTDESK_DEB"; then
|
||||||
echo "Download successful."
|
echo "Download successful."
|
||||||
else
|
else
|
||||||
|
|
@ -28,7 +29,7 @@ fi
|
||||||
|
|
||||||
echo "Installing RustDesk..."
|
echo "Installing RustDesk..."
|
||||||
|
|
||||||
# Attempting to install the RustDesk package
|
# Attempt to install the RustDesk package
|
||||||
if sudo dpkg -i "$RUSTDESK_DEB"; then
|
if sudo dpkg -i "$RUSTDESK_DEB"; then
|
||||||
echo "RustDesk installed successfully."
|
echo "RustDesk installed successfully."
|
||||||
else
|
else
|
||||||
|
|
@ -41,6 +42,35 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Configuring RustDesk..."
|
||||||
|
|
||||||
|
# Assuming RustDesk configuration file path; adjust as necessary
|
||||||
|
CONFIG_PATH="$HOME/.config/rustdesk/hbb.conf"
|
||||||
|
|
||||||
|
# Create config directory if it doesn't exist
|
||||||
|
mkdir -p "$(dirname "$CONFIG_PATH")"
|
||||||
|
|
||||||
|
# Set the ID server address
|
||||||
|
echo "id_server = \"$ID_SERVER\"" > "$CONFIG_PATH"
|
||||||
|
|
||||||
|
echo "Configuration updated."
|
||||||
|
|
||||||
|
echo "Starting RustDesk..."
|
||||||
|
|
||||||
|
# Assuming the RustDesk binary name; adjust path as necessary
|
||||||
|
# Note: The exact path may vary depending on the installation method and version
|
||||||
|
if pgrep rustdesk; then
|
||||||
|
echo "RustDesk is already running."
|
||||||
|
else
|
||||||
|
if command -v rustdesk &> /dev/null; then
|
||||||
|
rustdesk &
|
||||||
|
echo "RustDesk client started."
|
||||||
|
else
|
||||||
|
echo "Error: RustDesk client could not be found. Please check the installation."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Cleaning up..."
|
echo "Cleaning up..."
|
||||||
rm -f "$RUSTDESK_DEB"
|
rm -f "$RUSTDESK_DEB"
|
||||||
echo "Installation complete."
|
echo "Installation complete."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue