2024-04-29 16:10:05 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Copyright (c) 2021-2024 tteck
|
|
|
|
# Author: tteck
|
|
|
|
# Co-Author: MickLesk (Canbiz)
|
|
|
|
# License: MIT
|
|
|
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
|
|
|
# Source: https://github.com/ErsatzTV/ErsatzTV
|
|
|
|
|
|
|
|
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
|
|
|
|
color
|
|
|
|
verb_ip6
|
|
|
|
catch_errors
|
|
|
|
setting_up_container
|
|
|
|
network_check
|
|
|
|
update_os
|
|
|
|
|
2024-07-25 19:50:00 +02:00
|
|
|
msg_info "Installing Dependencies"
|
|
|
|
$STD apt-get install -y curl
|
|
|
|
$STD apt-get install -y sudo
|
|
|
|
$STD apt-get install -y mc
|
2024-04-29 16:10:05 +02:00
|
|
|
msg_ok "Installed Dependencies"
|
|
|
|
|
2024-07-25 19:50:00 +02:00
|
|
|
msg_info "Installing FFmpeg (Patience)"
|
2024-09-17 11:08:55 +02:00
|
|
|
wget -q https://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb
|
|
|
|
$STD dpkg -i deb-multimedia-keyring_2016.8.1_all.deb
|
|
|
|
cat <<EOF >/etc/apt/sources.list.d/backports.list
|
|
|
|
deb https://www.deb-multimedia.org bookworm main non-free
|
|
|
|
deb https://www.deb-multimedia.org bookworm-backports main
|
|
|
|
EOF
|
2024-07-25 19:50:00 +02:00
|
|
|
$STD apt update
|
2024-09-17 11:08:55 +02:00
|
|
|
DEBIAN_FRONTEND=noninteractive $STD apt-get install -t bookworm-backports ffmpeg -y
|
|
|
|
rm /etc/apt/sources.list.d/backports.list
|
2024-07-25 19:50:00 +02:00
|
|
|
$STD apt update
|
|
|
|
msg_ok "Installed FFmpeg"
|
2024-04-29 16:10:05 +02:00
|
|
|
|
2024-07-25 19:50:00 +02:00
|
|
|
msg_info "Installing ErsatzTV"
|
2024-04-29 16:10:05 +02:00
|
|
|
RELEASE=$(curl -s https://api.github.com/repos/ErsatzTV/ErsatzTV/releases | grep -oP '"tag_name": "\K[^"]+' | head -n 1)
|
|
|
|
wget -qO- "https://github.com/ErsatzTV/ErsatzTV/releases/download/${RELEASE}/ErsatzTV-${RELEASE}-linux-x64.tar.gz" | tar -xz -C /opt
|
|
|
|
mv "/opt/ErsatzTV-${RELEASE}-linux-x64" /opt/ErsatzTV
|
|
|
|
msg_ok "Installed ErsatzTV"
|
|
|
|
|
|
|
|
msg_info "Creating Service"
|
|
|
|
cat <<EOF >/etc/systemd/system/ersatzTV.service
|
|
|
|
[Unit]
|
|
|
|
Description=ErsatzTV Service
|
|
|
|
After=multi-user.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
|
|
|
User=root
|
|
|
|
WorkingDirectory=/opt/ErsatzTV
|
|
|
|
ExecStart=/opt/ErsatzTV/ErsatzTV
|
|
|
|
Restart=always
|
|
|
|
RestartSec=30
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
EOF
|
|
|
|
systemctl -q --now enable ersatzTV.service
|
|
|
|
msg_ok "Created Service"
|
|
|
|
|
|
|
|
motd_ssh
|
|
|
|
customize
|
|
|
|
|
|
|
|
msg_info "Cleaning up"
|
2024-05-02 19:26:16 +02:00
|
|
|
$STD apt-get -y autoremove
|
|
|
|
$STD apt-get -y autoclean
|
2024-04-29 16:10:05 +02:00
|
|
|
msg_ok "Cleaned"
|