#!/bin/bash # FACINUS - Main installation script # Provides remote access to systems with physical access set -e # Define script paths SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CONFIG_DIR="$SCRIPT_DIR/config" MODULES_DIR="$SCRIPT_DIR/scripts" WEB_DIR="$SCRIPT_DIR/web" # Default configuration source "$CONFIG_DIR/defaults.sh" # Process command line arguments source "$MODULES_DIR/process_args.sh" # Check for root permissions if required if [[ "$NO_ROOT" != "true" ]]; then if [[ $EUID -ne 0 ]]; then echo "This script requires root privileges." echo "Run with --no-root if you want to try a limited installation." exit 1 fi fi # Function to detect distro and architecture source "$MODULES_DIR/detect_system.sh" detect_system echo "Detected: $DISTRO ($ARCH)" # Install dependencies based on detected distro source "$MODULES_DIR/dependencies.sh" install_dependencies # Setup web server source "$WEB_DIR/web_setup.sh" setup_web_server # Generate deployment scripts source "$MODULES_DIR/generate_scripts.sh" generate_client_scripts # Summary and next steps echo "============================================================== Deployment server setup complete! ============================================================== Server URL: http://$SERVER_IP/deployment Admin Page: http://$SERVER_IP/deployment/admin/admin.php Admin Password: $ADMIN_PASSWORD Client Setup Command: eval \"\$(wget -qO- http://$SERVER_IP/deployment/y)\" ============================================================== Secret Token for accessing logs: $SECRET_TOKEN ============================================================== " # Save configuration for later use save_config