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
|
||||
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."
|
||||
|
|
|
|||
Loading…
Reference in a new issue