Update rustdesk.sh
This commit is contained in:
parent
a0904b6fb7
commit
403b3bd0bd
1 changed files with 18 additions and 17 deletions
33
rustdesk.sh
33
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_DEB="rustdesk-1.2.3-x86_64.deb"
|
||||
ID_SERVER="192.168.1.242"
|
||||
PACKAGE_NAME="rustdesk"
|
||||
|
||||
# Check for curl
|
||||
if ! command -v curl &> /dev/null; then
|
||||
|
|
@ -11,6 +12,17 @@ if ! command -v curl &> /dev/null; then
|
|||
exit 1
|
||||
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..."
|
||||
|
||||
# Download the RustDesk .deb package
|
||||
|
|
@ -44,31 +56,20 @@ fi
|
|||
|
||||
echo "Configuring RustDesk..."
|
||||
|
||||
# Assuming RustDesk configuration file path; adjust as necessary
|
||||
# Configure RustDesk
|
||||
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 &
|
||||
# Start RustDesk
|
||||
if ! pgrep -x "rustdesk" > /dev/null; then
|
||||
rustdesk &> /dev/null &
|
||||
echo "RustDesk client started."
|
||||
else
|
||||
echo "Error: RustDesk client could not be found. Please check the installation."
|
||||
exit 1
|
||||
fi
|
||||
echo "RustDesk is already running."
|
||||
fi
|
||||
|
||||
echo "Cleaning up..."
|
||||
|
|
|
|||
Loading…
Reference in a new issue