ffplayout/debian/postinst

34 lines
896 B
Plaintext
Raw Normal View History

2023-06-13 14:25:11 +02:00
#!/bin/sh
#DEBHELPER#
2022-07-19 12:11:14 +02:00
sysUser="ffpu"
if [ -f /run/.containerenv ] || [ -f /run/.dockerenv ] || [ -f /.dockerenv ] || [ -f /.dockerinit ]; then
sysUser="root"
fi
2023-03-28 14:21:41 +02:00
if [ ! $(id -u $sysUser 2>/dev/null || echo -1) -ge 0 ]; then
2023-07-13 11:25:08 +02:00
adduser --system --create-home $sysUser > /dev/null || adduser --system --home "/home/$sysUser" $sysUser
2022-07-19 12:11:14 +02:00
fi
if [ ! -d "/usr/share/ffplayout/db" ]; then
mkdir "/usr/share/ffplayout/db"
mkdir -p "/usr/share/ffplayout/public/live"
2022-07-19 13:34:31 +02:00
mkdir -p "/var/lib/ffplayout/playlists"
mkdir -p "/var/lib/ffplayout/tv-media"
IP=$(hostname -I | cut -d ' ' -f1)
2022-12-20 09:24:54 +01:00
/usr/bin/ffpapi -i -d "${IP}:8787"
2023-07-14 13:42:20 +02:00
chown -R ${sysUser}: "/usr/share/ffplayout"
chown -R ${sysUser}: "/var/lib/ffplayout"
chown -R ${sysUser}: "/etc/ffplayout"
fi
2022-07-07 21:12:59 +02:00
if [ ! -d "/var/log/ffplayout" ]; then
2022-07-19 12:11:14 +02:00
mkdir "/var/log/ffplayout"
2022-07-07 21:12:59 +02:00
2023-07-14 13:42:20 +02:00
chown ${sysUser}: "/var/log/ffplayout"
2022-07-07 21:12:59 +02:00
fi