8914f4dce9
- Created `TV_SHOWS_SQL_QUERY_PATTERNS.md` to document SQL query patterns for TV shows, including performance issues and missing indexes. - Added `README.md` for Linux package building, detailing steps for creating Debian and Red Hat packages. - Implemented build scripts for Debian and Red Hat, including service files and post-installation hooks. - Added necessary scripts for managing Jellyfin service lifecycle on both Debian and Red Hat systems. - Included package specifications and installation instructions for both distributions.
35 lines
928 B
Bash
35 lines
928 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
# Jellyfin Post-Installation Script (Debian)
|
|
# Runs after package is installed
|
|
|
|
# Create jellyfin user/group if not exists
|
|
if ! id "jellyfin" &>/dev/null; then
|
|
echo "Creating jellyfin user and group..."
|
|
useradd -r -s /bin/false -d /var/lib/jellyfin jellyfin
|
|
fi
|
|
|
|
# Create necessary directories
|
|
mkdir -p /var/lib/jellyfin
|
|
mkdir -p /var/log/jellyfin
|
|
mkdir -p /etc/jellyfin
|
|
|
|
# Set ownership and permissions
|
|
chown -R jellyfin:jellyfin /opt/jellyfin
|
|
chown -R jellyfin:jellyfin /var/lib/jellyfin
|
|
chown -R jellyfin:jellyfin /var/log/jellyfin
|
|
|
|
chmod 755 /opt/jellyfin
|
|
chmod 750 /var/lib/jellyfin
|
|
chmod 750 /var/log/jellyfin
|
|
|
|
# Enable and start service if systemd is available
|
|
if command -v systemctl &> /dev/null; then
|
|
systemctl daemon-reload || true
|
|
systemctl enable jellyfin.service || true
|
|
echo "To start Jellyfin, run: sudo systemctl start jellyfin"
|
|
fi
|
|
|
|
echo "Jellyfin post-install complete!"
|