#!/bin/bash # RDP Client Simple Installation Script (HTTPS version) # This script clones the repository via HTTPS and installs all dependencies set -e # Exit on any error # Colors for output RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' NC='\033[0m' # No Color # Configuration REPO_URL="https://gitea.egonetix.de/root/rdp_client.git" INSTALL_DIR="$HOME/rdp-client" echo -e "${BLUE}=== RDP Client Simple Installation (HTTPS) ===${NC}" echo "This script will download and install the RDP client using HTTPS." echo # Function to check if command exists command_exists() { command -v "$1" >/dev/null 2>&1 } # Install system dependencies echo -e "${YELLOW}Installing system dependencies...${NC}" if command_exists apt-get; then sudo apt-get update sudo apt-get install -y freerdp2-x11 python3 python3-pip python3-venv git python3-tk elif command_exists dnf; then sudo dnf install -y freerdp python3 python3-pip git python3-tkinter elif command_exists pacman; then sudo pacman -S --noconfirm freerdp python python-pip git tk else echo -e "${RED}Please install manually: freerdp, python3, python3-pip, python3-tk, git${NC}" exit 1 fi # Clone repository echo -e "${YELLOW}Downloading RDP client...${NC}" if [ -d "$INSTALL_DIR" ]; then echo "Updating existing installation..." cd "$INSTALL_DIR" && git pull else git clone "$REPO_URL" "$INSTALL_DIR" fi # Setup Python environment echo -e "${YELLOW}Setting up Python environment...${NC}" cd "$INSTALL_DIR" python3 -m venv .venv source .venv/bin/activate pip install --upgrade pip pip install cryptography # Create launcher echo -e "${YELLOW}Creating launcher...${NC}" mkdir -p "$HOME/.local/bin" cat > "$HOME/.local/bin/rdp-client" << EOF #!/bin/bash cd "$INSTALL_DIR" source .venv/bin/activate python rdp_client.py "\$@" EOF chmod +x "$HOME/.local/bin/rdp-client" echo -e "${GREEN}=== Installation Complete! ===${NC}" echo "Run with: rdp-client" echo "Or directly: $INSTALL_DIR/.venv/bin/python $INSTALL_DIR/rdp_client.py"