torrent-man/modules/file-creator-module.sh
Claude 9e544456db Initial commit with UI fixes for dark mode
This repository contains Transmission RSS Manager with the following changes:
- Fixed dark mode navigation tab visibility issue
- Improved text contrast in dark mode throughout the app
- Created dedicated dark-mode.css for better organization
- Enhanced JavaScript for dynamic styling in dark mode
- Added complete installation scripts

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-13 17:16:41 +00:00

75 lines
1.7 KiB
Bash
Executable File

#\!/bin/bash
# This module handles creating necessary files
# Function to create systemd service file
create_systemd_service_file() {
local install_dir=$1
local service_name=$2
local description=$3
local exec_command=$4
local service_file="/tmp/$service_name.service"
echo "Creating systemd service file for $service_name..."
cat > "$service_file" << EOL
[Unit]
Description=$description
After=network.target
[Service]
Type=simple
User=$(whoami)
WorkingDirectory=$install_dir
ExecStart=$exec_command
Restart=on-failure
RestartSec=10
SyslogIdentifier=$service_name
Environment=ASPNETCORE_ENVIRONMENT=Production
[Install]
WantedBy=multi-user.target
EOL
sudo mv "$service_file" "/etc/systemd/system/$service_name.service"
sudo systemctl daemon-reload
echo "Service file created for $service_name"
}
# Function to create a simple start script
create_start_script() {
local install_dir=$1
local script_path="$install_dir/start.sh"
echo "Creating start script..."
cat > "$script_path" << 'EOL'
#\!/bin/bash
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${GREEN}Starting Transmission RSS Manager...${NC}"
echo -e "${GREEN}The web interface will be available at: http://localhost:5000${NC}"
echo -e "${YELLOW}Press Ctrl+C to stop the application${NC}"
./TransmissionRssManager --urls=http://0.0.0.0:5000
EOL
chmod +x "$script_path"
echo "Start script created at $script_path"
}
# Function to create logs directory
create_logs_directory() {
local install_dir=$1
local logs_dir="$install_dir/logs"
mkdir -p "$logs_dir"
echo "Logs directory created at $logs_dir"
}