transmission-rss-manager/main-installer.sh

63 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
# Transmission RSS Manager Modular Installer
# Main installer script that coordinates the installation process
# Text formatting
BOLD='\033[1m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Print header
echo -e "${BOLD}==================================================${NC}"
echo -e "${BOLD} Transmission RSS Manager Installer ${NC}"
echo -e "${BOLD} Version 1.2.0 - Enhanced Edition ${NC}"
echo -e "${BOLD}==================================================${NC}"
echo
# Check if script is run with sudo
if [ "$EUID" -ne 0 ]; then
echo -e "${RED}Please run as root (use sudo)${NC}"
exit 1
fi
# Get current directory
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# Source the module files
source "${SCRIPT_DIR}/modules/config.sh"
source "${SCRIPT_DIR}/modules/utils.sh"
source "${SCRIPT_DIR}/modules/dependencies.sh"
source "${SCRIPT_DIR}/modules/file_creator.sh"
source "${SCRIPT_DIR}/modules/service_setup.sh"
# Execute the installation steps in sequence
echo -e "${YELLOW}Starting installation process...${NC}"
# Step 1: Gather configuration from user
gather_configuration
# Step 2: Install dependencies
install_dependencies
# Step 3: Create installation directories
create_directories
# Step 4: Create configuration files and scripts
create_config_files
# Step 5: Create service files and install the service
setup_service
# Step 6: Final setup and permissions
finalize_setup
echo -e "${GREEN}Installation completed successfully!${NC}"
echo -e "You can access the RSS Manager at ${BOLD}http://localhost:${PORT}${NC} or ${BOLD}http://your-server-ip:${PORT}${NC}"
echo
echo -e "The service is ${BOLD}automatically started${NC} and will ${BOLD}start on boot${NC}."
echo -e "To manually control the service, use: ${BOLD}sudo systemctl [start|stop|restart] ${SERVICE_NAME}${NC}"
echo
echo -e "${BOLD}Thank you for installing Transmission RSS Manager Enhanced Edition!${NC}"