From a0904b6fb71c33d14d7ef0c03ec4ed5b661a4630 Mon Sep 17 00:00:00 2001 From: Spencer Flagg Date: Mon, 5 Feb 2024 10:05:55 +0000 Subject: [PATCH] Update rustdesk.sh --- rustdesk.sh | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/rustdesk.sh b/rustdesk.sh index 7504f49..ed0c0e0 100644 --- a/rustdesk.sh +++ b/rustdesk.sh @@ -3,6 +3,7 @@ # Variables 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" +ID_SERVER="192.168.1.242" # Check for curl if ! command -v curl &> /dev/null; then @@ -12,7 +13,7 @@ fi echo "Downloading RustDesk..." -# Downloading the RustDesk .deb package +# Download the RustDesk .deb package if curl -L "$RUSTDESK_URL" -o "$RUSTDESK_DEB"; then echo "Download successful." else @@ -28,7 +29,7 @@ fi echo "Installing RustDesk..." -# Attempting to install the RustDesk package +# Attempt to install the RustDesk package if sudo dpkg -i "$RUSTDESK_DEB"; then echo "RustDesk installed successfully." else @@ -41,6 +42,35 @@ else 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..." rm -f "$RUSTDESK_DEB" echo "Installation complete."