Skip to content

Commit 5849fcb

Browse files
committedSep 26, 2022
Add installation script
This change adds an installation script to reduce the installation to a single step. By adding this script, we can also warn users that they are not inside UniFi OS.
1 parent 0e8756e commit 5849fcb

File tree

2 files changed

+66
-62
lines changed

2 files changed

+66
-62
lines changed
 

‎README.md

+14-62
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,10 @@ multicast IPTV traffic between WAN and LAN.
116116

117117
### Installation
118118
SSH into your machine and execute the commands below in UniFi OS (not in UbiOS).
119-
On the UniFi Dream Machine (Pro), use `unifi-os shell` to enter UniFi OS from
120-
within UbiOS.
121119
```bash
122-
# Download udm-iptv package
123-
curl -O -L https://github.com/fabianishere/udm-iptv/releases/download/v2.1.4/udm-iptv_2.1.4_all.deb
124-
# Download a recent igmpproxy version
125-
curl -O -L http://ftp.debian.org/debian/pool/main/i/igmpproxy/igmpproxy_0.3-1_arm64.deb
126-
# Update APT sources and install dialog package for interactive install
127-
apt update && apt install dialog
128-
# Install udm-iptv and igmpproxy
129-
apt install ./igmpproxy_0.3-1_arm64.deb ./udm-iptv_2.1.4_all.deb
120+
curl https://raw.githubusercontent.com/fabianishere/udm-iptv/master/install.sh -sSf | sh
130121
```
131122

132-
It may be possible that `apt` reports a warning after installation (like shown below),
133-
but this has no effect on the installation process, so you can simply ignore it.
134-
> N: Download is performed unsandboxed as root as file '/root/igmpproxy_0.3-1_arm64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
135-
136123
This script will install the `udm-iptv` package onto your device.
137124
The installation process supports various pre-defined configuration profiles for
138125
popular IPTV providers. Below is a list of supported IPTV providers:
@@ -157,7 +144,7 @@ popular IPTV providers. Below is a list of supported IPTV providers:
157144
If your ISP is not supported, you may select the _Custom_ profile, which allows
158145
you manually configure the package to your needs.
159146
We appreciate if you share the configuration so others can also benefit.
160-
See the [profiles](profiles/) directory for examples of existing configuration
147+
See the [profiles](profiles) directory for examples of existing configuration
161148
profiles.
162149

163150
The package installs a service that is started during the
@@ -211,14 +198,7 @@ See below for a reference of the available options to configure:
211198
The configuration is written to `/etc/udm-iptv.conf` (within UniFi OS).
212199

213200
### Upgrading
214-
Upgrading the installation of udm-iptv is achieved by downloading a new version
215-
of the package and installing it via `apt`. The service should automatically
216-
restart after upgrading.
217-
218-
```bash
219-
curl -O -L https://github.com/fabianishere/udm-iptv/releases/download/v2.1.4/udm-iptv_2.1.4_all.deb
220-
apt install ./udm-iptv_2.1.4_all.deb
221-
```
201+
To upgrade `udm-iptv`, please re-run the installation script.
222202

223203
### Removal
224204
To fully remove an `udm-iptv` installation from your UniFi device, run the follow command:
@@ -230,48 +210,20 @@ In order to remove all configuration files as well, run the following command:
230210
apt purge dialog igmpproxy udm-iptv
231211
```
232212

233-
## Troubleshooting and Known Issues
213+
## Troubleshooting
234214

235215
Below is a non-exhaustive list of issues that might occur while getting IPTV to
236216
run on your UniFi device, as well as troubleshooting steps. Please check these
237-
instructions before reporting an issue on issue tracker.
238-
239-
### Debugging DHCP
240-
241-
Use the following steps to verify whether the IPTV container is obtaining an
242-
IP address from the IPTV network via DHCP:
243-
244-
1. Verify that the VLAN interface has obtained an IP address:
245-
```bash
246-
$ ip -4 addr show dev iptv
247-
43: iptv@eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
248-
inet XX.XX.XX.XX/22 brd XX.XX.XX.XX scope global iptv
249-
valid_lft forever preferred_lft forever
250-
```
251-
2. Verify that you have obtained the routes from the DHCP server:
252-
```bash
253-
$ ip route list
254-
...
255-
XX.XX.XX.X/21 via XX.XX.XX.X dev iptv
256-
```
257-
258-
### Debugging IGMP Proxy
259-
260-
Use the following steps to debug `igmpproxy` if it is behaving strangely.
261-
Make sure you are running inside UniFi OS.
262-
263-
1. **Enabling debug logs**
264-
You can enable `igmpproxy` to report debug messages by setting `IPTV_IGMPPROXY_DEBUG`
265-
to `true` in the configuration at `/etc/udm-iptv.conf` (within UniFi OS).
266-
Then, restart the service as follows:
267-
```bash
268-
systemctl restart udm-iptv
269-
```
270-
2. **Viewing debug logs**
271-
You may now view the debug logs of `igmpproxy` as follows:
272-
```bash
273-
journalctl -u udm-iptv
274-
```
217+
instructions before opening a discussion.
218+
219+
1. **Check if your IPTV receiver is on the right VLAN**
220+
Your IPTV receiver might not be VLAN to which the IPTV traffic is forwarded.
221+
2. **Check if IPTV traffic is forwarded to the right VLAN**
222+
Make sure that you have configured `IPTV_LAN_INTERFACES` correctly to forward
223+
to right interfaces (e.g., `br4` for VLAN 4).
224+
3. **Check if your issue has been reported already**
225+
Use the GitHub search functionality to check if your issue has already been
226+
reported before.
275227

276228
### Getting Help or Reporting an Issue
277229
If your issues persist, you may seek help on our [Discussions](https://github.com/fabianishere/udm-iptv/discussions) page.

‎install.sh

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/sh
2+
# Installation script for the udm-iptv service
3+
#
4+
# Copyright (C) 2022 Fabian Mastenbroek.
5+
#
6+
# This program is free software; you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation; either version 2 of the License, or
9+
# (at your option) any later version.
10+
11+
set -e
12+
13+
if command -v unifi-os > /dev/null 2>&1; then
14+
echo "error: You need to be in UniFi OS to run the installer."
15+
echo "Please run the following command to enter UniFi OS:"
16+
echo
17+
printf "\t unifi-os shell\n"
18+
exit 1
19+
fi
20+
21+
UDM_IPTV_VERSION=2.1.4
22+
IGMPPROXY_VERSION=0.3-1
23+
24+
dest=$(mktemp -d)
25+
26+
echo "Downloading packages..."
27+
28+
# Download udm-iptv package
29+
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"
30+
31+
# Download a recent igmpproxy version
32+
curl -sS -o "$dest/igmpproxy.deb" -L "http://ftp.debian.org/debian/pool/main/i/igmpproxy/igmpproxy_${IGMPPROXY_VERSION}_arm64.deb"
33+
34+
# Fix permissions on the packages
35+
chown _apt:root "$dest/udm-iptv.deb" "$dest/igmpproxy.deb"
36+
37+
echo "Installing packages..."
38+
39+
# Update APT sources
40+
apt-get update -q
41+
42+
# Install dialog package for interactive install
43+
apt-get install -q -y dialog
44+
45+
# Install udm-iptv and igmpproxy
46+
apt install -q -y "$dest/udm-iptv.deb" "$dest/igmpproxy.deb"
47+
48+
echo "Installation successful... You can find your configuration at /etc/udm-iptv.conf."
49+
echo
50+
echo "Use the following command to reconfigure the script:"
51+
echo
52+
printf "\t dpkg-reconfigure -p medium udm-iptv\n"

0 commit comments

Comments
 (0)
Please sign in to comment.