Update rustdesk.sh
This commit is contained in:
parent
a0904b6fb7
commit
403b3bd0bd
1 changed files with 18 additions and 17 deletions
35
rustdesk.sh
35
rustdesk.sh
|
|
@ -4,6 +4,7 @@
|
||||||
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"
|
ID_SERVER="192.168.1.242"
|
||||||
|
PACKAGE_NAME="rustdesk"
|
||||||
|
|
||||||
# Check for curl
|
# Check for curl
|
||||||
if ! command -v curl &> /dev/null; then
|
if ! command -v curl &> /dev/null; then
|
||||||
|
|
@ -11,6 +12,17 @@ if ! command -v curl &> /dev/null; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if RustDesk is already installed and remove it
|
||||||
|
if dpkg -l | grep -qw "$PACKAGE_NAME"; then
|
||||||
|
echo "RustDesk is already installed. Removing..."
|
||||||
|
if sudo dpkg --purge "$PACKAGE_NAME"; then
|
||||||
|
echo "Successfully removed existing RustDesk installation."
|
||||||
|
else
|
||||||
|
echo "Failed to remove existing RustDesk. Exiting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Downloading RustDesk..."
|
echo "Downloading RustDesk..."
|
||||||
|
|
||||||
# Download the RustDesk .deb package
|
# Download the RustDesk .deb package
|
||||||
|
|
@ -44,31 +56,20 @@ fi
|
||||||
|
|
||||||
echo "Configuring RustDesk..."
|
echo "Configuring RustDesk..."
|
||||||
|
|
||||||
# Assuming RustDesk configuration file path; adjust as necessary
|
# Configure RustDesk
|
||||||
CONFIG_PATH="$HOME/.config/rustdesk/hbb.conf"
|
CONFIG_PATH="$HOME/.config/rustdesk/hbb.conf"
|
||||||
|
|
||||||
# Create config directory if it doesn't exist
|
|
||||||
mkdir -p "$(dirname "$CONFIG_PATH")"
|
mkdir -p "$(dirname "$CONFIG_PATH")"
|
||||||
|
|
||||||
# Set the ID server address
|
|
||||||
echo "id_server = \"$ID_SERVER\"" > "$CONFIG_PATH"
|
echo "id_server = \"$ID_SERVER\"" > "$CONFIG_PATH"
|
||||||
|
|
||||||
echo "Configuration updated."
|
echo "Configuration updated."
|
||||||
|
|
||||||
echo "Starting RustDesk..."
|
echo "Starting RustDesk..."
|
||||||
|
|
||||||
# Assuming the RustDesk binary name; adjust path as necessary
|
# Start RustDesk
|
||||||
# Note: The exact path may vary depending on the installation method and version
|
if ! pgrep -x "rustdesk" > /dev/null; then
|
||||||
if pgrep rustdesk; then
|
rustdesk &> /dev/null &
|
||||||
echo "RustDesk is already running."
|
echo "RustDesk client started."
|
||||||
else
|
else
|
||||||
if command -v rustdesk &> /dev/null; then
|
echo "RustDesk is already running."
|
||||||
rustdesk &
|
|
||||||
echo "RustDesk client started."
|
|
||||||
else
|
|
||||||
echo "Error: RustDesk client could not be found. Please check the installation."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Cleaning up..."
|
echo "Cleaning up..."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue