forked from fabianishere/udm-iptv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·51 lines (38 loc) · 1.48 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
# Installation script for the udm-iptv service
#
# Copyright (C) 2022 Fabian Mastenbroek.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
set -e
if command -v unifi-os > /dev/null 2>&1; then
echo "error: You need to be in UniFi OS to run the installer."
echo "Please run the following command to enter UniFi OS:"
echo
printf "\t unifi-os shell\n"
exit 1
fi
UDM_IPTV_VERSION=3.0.5
dest=$(mktemp -d)
echo "Downloading packages..."
# Download udm-iptv package
curl -sS -o "$dest/udm-iptv.deb" -L "https://github.com/fabianishere/udm-iptv/releases/download/v$UDM_IPTV_VERSION/udm-iptv_${UDM_IPTV_VERSION}_all.deb"
# Fix permissions on the packages
chown _apt:root "$dest/udm-iptv.deb"
echo "Installing packages..."
# Update APT sources (best effort)
apt-get update 2>&1 1>/dev/null || true
# Install dialog package for interactive install
apt-get install -q -y dialog 2>&1 1>/dev/null || echo "Failed to install dialog... Using readline frontend"
# Install udm-iptv
apt-get install -o Acquire::AllowUnsizedPackages=1 -q "$dest/udm-iptv.deb"
# Delete downloaded packages
rm -rf "$dest"
echo "Installation successful... You can find your configuration at /etc/udm-iptv.conf."
echo
echo "Use the following command to reconfigure the script:"
echo
printf "\t udm-iptv reconfigure\n"