#!/bin/sh
set -e

mkdir -p /etc/jellyfin-client
if [ ! -f /etc/jellyfin-client/config.yaml ] && [ -f /etc/jellyfin-client/config.example.yaml ]; then
    cp /etc/jellyfin-client/config.example.yaml /etc/jellyfin-client/config.yaml
    chmod 644 /etc/jellyfin-client/config.yaml 2>/dev/null || true
fi

if [ -d /run/systemd/system ]; then
    systemctl daemon-reload || true
fi

exit 0
