Fix RustDesk hook to install curl before downloading

- Modified hook to install curl if not available before attempting download
- Simplified download logic to use curl directly
- This ensures the download tool is available during hook execution
parent e36ee822
......@@ -5,19 +5,19 @@ set -e
echo "Installing RustDesk .deb package..."
# Install curl if not available
if ! command -v curl >/dev/null 2>&1; then
echo "Installing curl for downloading..."
apt-get update
apt-get install -y curl
fi
# Download RustDesk .deb package
RUSTDESK_URL="https://github.com/rustdesk/rustdesk/releases/download/1.4.1/rustdesk-1.4.1-x86_64.deb"
RUSTDESK_DEB="/tmp/rustdesk-1.4.1-x86_64.deb"
echo "Downloading RustDesk from $RUSTDESK_URL..."
if command -v wget >/dev/null 2>&1; then
wget -q -O "$RUSTDESK_DEB" "$RUSTDESK_URL"
elif command -v curl >/dev/null 2>&1; then
curl -s -L -o "$RUSTDESK_DEB" "$RUSTDESK_URL"
else
echo "Error: Neither wget nor curl is available for downloading"
exit 1
fi
curl -s -L -o "$RUSTDESK_DEB" "$RUSTDESK_URL"
# Verify download
if [ ! -f "$RUSTDESK_DEB" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment