ffplayout/debian/postinst
2024-10-06 20:05:12 +02:00

29 lines
774 B
Bash

#!/bin/sh
#DEBHELPER#
sysUser="ffpu"
if [ -f /run/.containerenv ] || [ -f /run/.dockerenv ] || [ -f /.dockerenv ] || [ -f /.dockerinit ]; then
sysUser="root"
fi
if [ ! $(id -u $sysUser 2>/dev/null || echo -1) -ge 0 ]; then
adduser --system --create-home $sysUser > /dev/null || adduser --system --home "/home/$sysUser" $sysUser
fi
if [ ! -d "/usr/share/ffplayout/db" ]; then
mkdir "/usr/share/ffplayout/db"
mkdir -p "/usr/share/ffplayout/public/live"
mkdir -p "/var/lib/ffplayout/playlists"
mkdir -p "/var/lib/ffplayout/tv-media"
chown -R ${sysUser}: "/usr/share/ffplayout"
chown -R ${sysUser}: "/var/lib/ffplayout"
fi
if [ ! -d "/var/log/ffplayout" ]; then
mkdir "/var/log/ffplayout"
chown ${sysUser}: "/var/log/ffplayout"
fi