Add new file

This commit is contained in:
Spencer Flagg 2024-02-04 21:42:40 +00:00
parent 6dddfdf70c
commit 886c74f1f5

42
rustdesk.sh Normal file
View file

@ -0,0 +1,42 @@
#!/bin/bash
# Define the RustDesk deb package URL
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"
# Download RustDesk deb package
echo "Downloading RustDesk..."
curl -L "$RUSTDESK_URL" -o "$RUSTDESK_DEB" 2>/dev/null
# Verify that the download was successful
if [ $? -ne 0 ]; then
echo "Error: Failed to download RustDesk."
exit 1
else
echo "Download successful."
fi
# Install RustDesk
echo "Installing RustDesk..."
sudo dpkg -i "$RUSTDEK_DEB"
# Check if dpkg encountered any errors
if [ $? -ne 0 ]; then
echo "Error: dpkg encountered an issue installing RustDesk. Attempting to fix..."
sudo apt-get install -f
# Check if apt-get fixed the issue
if [ $? -ne 0 ]; then
echo "Error: Failed to resolve dependencies automatically."
exit 2
else
echo "Dependencies resolved and RustDesk installed successfully."
fi
else
echo "RustDesk installed successfully."
fi
# Cleanup downloaded package
echo "Cleaning up..."
rm "$RUSTDESK_DEB"
echo "Installation complete."