torrent-man/modules/dependencies-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

86 lines
2.4 KiB
Bash
Executable File

#\!/bin/bash
# This module handles installing dependencies
install_dependencies() {
echo "Checking and installing dependencies..."
# Check if we're on a Debian/Ubuntu system
if command -v apt-get &> /dev/null; then
install_debian_dependencies
# Check if we're on a RHEL/CentOS/Fedora system
elif command -v yum &> /dev/null || command -v dnf &> /dev/null; then
install_rhel_dependencies
else
echo "Unsupported package manager. Please install dependencies manually."
return 1
fi
# Install .NET runtime if needed
install_dotnet
return 0
}
install_debian_dependencies() {
echo "Installing dependencies for Debian/Ubuntu..."
sudo apt-get update
sudo apt-get install -y wget curl jq unzip
return 0
}
install_rhel_dependencies() {
echo "Installing dependencies for RHEL/CentOS/Fedora..."
if command -v dnf &> /dev/null; then
sudo dnf install -y wget curl jq unzip
else
sudo yum install -y wget curl jq unzip
fi
return 0
}
install_dotnet() {
echo "Checking .NET runtime..."
# Check if .NET 7.0 is already installed
if command -v dotnet &> /dev/null; then
dotnet_version=$(dotnet --version)
if [[ $dotnet_version == 7.* ]]; then
echo ".NET 7.0 is already installed (version $dotnet_version)"
return 0
fi
fi
echo "Installing .NET 7.0 runtime..."
# For Debian/Ubuntu
if command -v apt-get &> /dev/null; then
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y dotnet-runtime-7.0
# For RHEL/CentOS/Fedora
elif command -v yum &> /dev/null || command -v dnf &> /dev/null; then
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
if command -v dnf &> /dev/null; then
sudo dnf install -y dotnet-runtime-7.0
else
sudo yum install -y dotnet-runtime-7.0
fi
else
echo "Unsupported system for automatic .NET installation. Please install .NET 7.0 runtime manually."
return 1
fi
echo ".NET 7.0 runtime installed successfully"
return 0
}