Skip to content

Instantly share code, notes, and snippets.

@e-roux
Last active May 12, 2019 15:14
Show Gist options
  • Save e-roux/915e8231f5718ae455347f6645ffab46 to your computer and use it in GitHub Desktop.
Save e-roux/915e8231f5718ae455347f6645ffab46 to your computer and use it in GitHub Desktop.
VDR
#!/bin/bash
# If no DVB adapter present, break
dmesg | grep -i DVB > /dev/null
if (($? != 0)); then exit 1;fi
# Install Firmware
sudo wget -q https://github.com/OpenELEC/dvb-firmware/blob/master/firmware/dvb-demod-m88ds3103.fw?raw=true -O /lib/firmware/dvb-demod-m88ds3103.fw
#---------------------------------------------------------
# Get sources
#---------------------------------------------------------
cd /tmp
# Récupération des sources, dernière version stable
wget ftp://ftp.tvdr.de/vdr/vdr-current.tar.bz2
# Extraction dans le répertoire vdr-src
mkdir vdr-src
tar xf vdr-current.tar.bz2 --directory vdr-src
cd vdr-src/vdr*
#---------------------------------------------------------
# PLUGINS
#---------------------------------------------------------
cd PLUGINS/src
# vnsiserver
git clone https://github.com/FernetMenta/vdr-plugin-vnsiserver
ln -s vdr-plugin-vnsiserver/ vnsiserver
# streamdev
git clone git://projects.vdr-developer.org/vdr-plugin-streamdev.git
ln -s vdr-plugin-streamdev streamdev
cd -
#---------------------------------------------------------
# Make and install
#---------------------------------------------------------
make
sudo make install
# create a user vdr
sudo groupadd vdr
sudo useradd --home /media/vdr -c "vdr daemon" -m -g vdr -G video,audio vdr
sudo usermod -L vdr
#---------------------------------------------------------
# streamdev and vnsiserver configuration
#---------------------------------------------------------
sudo mkdir -p /var/lib/vdr/plugins/streamdev-server
mask="$(ifconfig | sed -rn '2s/.*:(192.*)255 .*$/\1/p')0"
sudo bash -c "cat << EOF > /var/lib/vdr/plugins/streamdev-server/streamdevhosts.conf
#
# streamdevhosts This file describes a number of host addresses that
# are allowed to connect to the streamdev server running
# with the Video Disk Recorder (VDR) on this system.
# Accept localhost and any host on the local net
# Syntax:
#
# IP-Address[/Netmask]
#
127.0.0.1
${mask}/24
EOF
"
sudo bash -c "cat << EOF > /var/lib/vdr/plugins/vnsiserver/allowed_hosts.conf
#
# allowed_hosts.conf This file describes a number of host addresses that
# are allowed to connect to the streamdev server running
# with the Video Disk Recorder (VDR) on this system.
# Accept localhost and any host on the local net
# Syntax:
#
# IP-Address[/Netmask]
#
127.0.0.1
${mask}/24
EOF
"
sudo bash -c "cat << EOF > /var/lib/vdr/plugins/svdrphosts.conf
#
# svdrphosts This file describes a number of host addresses that
# are allowed to connect to the SVDRP port of the Video
# Disk Recorder (VDR) running on this system.
# Accept localhost and any host on the local net
#
#
# Syntax:
#
# IP-Address[/Netmask]
#
127.0.0.1
${mask}/24
EOF
"
sudo chown -R vdr.vdr /var/lib/vdr /var/cache/vdr /usr/local/lib/vdr /usr/local/bin/vdr /usr/local/share/vdr /usr/local/include/vdr /etc/vdr
mkdir -p /media/tv/
chown vdr /media/tv/install_vdr.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment