#\!/bin/bash # Installation script for Transmission RSS Manager # This will install the application with all the UI fixes included # Text colors GREEN='\033[0;32m' YELLOW='\033[1;33m' RED='\033[0;31m' NC='\033[0m' # No Color echo -e "${GREEN}Starting Transmission RSS Manager installation...${NC}" # Source utility modules if [ -d "./modules" ]; then source ./modules/utils-module.sh source ./modules/dependencies-module.sh source ./modules/config-module.sh source ./modules/service-setup-module.sh source ./modules/file-creator-module.sh else echo -e "${RED}Error: Required modules not found\!${NC}" exit 1 fi # Installation directory INSTALL_DIR="/opt/transmission-rss-manager" # Create installation directory echo -e "${GREEN}Creating installation directory...${NC}" sudo mkdir -p $INSTALL_DIR sudo chown $(whoami):$(whoami) $INSTALL_DIR # Install dependencies echo -e "${GREEN}Installing dependencies...${NC}" install_dependencies # Copy files to installation directory echo -e "${GREEN}Copying application files...${NC}" cp -r ./bin/net7.0/* $INSTALL_DIR/ cp -r ./wwwroot $INSTALL_DIR/ cp -r ./src $INSTALL_DIR/ # For reference only cp ./appsettings*.json $INSTALL_DIR/ cp ./run-app.sh $INSTALL_DIR/ # Make scripts executable chmod +x $INSTALL_DIR/run-app.sh chmod +x $INSTALL_DIR/TransmissionRssManager # Create default configuration echo -e "${GREEN}Creating configuration...${NC}" create_default_config $INSTALL_DIR/appsettings.json # Set up as a service echo -e "${GREEN}Setting up service...${NC}" setup_systemd_service $INSTALL_DIR # Final steps echo -e "${GREEN}Installation complete\!${NC}" echo -e "${YELLOW}The server can be accessed at: http://localhost:5000${NC}" echo -e "${YELLOW}To start the service: sudo systemctl start transmission-rss-manager${NC}" echo -e "${YELLOW}To enable at boot: sudo systemctl enable transmission-rss-manager${NC}" echo -e "${YELLOW}To check status: sudo systemctl status transmission-rss-manager${NC}" echo -e "${YELLOW}To run manually: cd $INSTALL_DIR && ./run-app.sh${NC}" # Ask if user wants to start the service now read -p "Do you want to start the service now? (y/n) " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]]; then sudo systemctl start transmission-rss-manager echo -e "${GREEN}Service started\!${NC}" echo -e "${YELLOW}You can access the web interface at: http://localhost:5000${NC}" fi exit 0