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