Files
Arch-R/packages/addons/driver/hdhomerun/source/bin/hdhomerun.service
T
peter a76fa009f8 linux: HDHomeRun TV tuner DVB driver
and belonging addon
2012-01-02 12:47:50 +01:00

63 lines
2.0 KiB
Desktop File
Executable File

#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
#
# 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, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
ADDON_NAME="driver.dvb.hdhomerun"
ADDON_DIR="$HOME/.xbmc/addons/$ADDON_NAME"
ADDON_HOME="$HOME/.xbmc/userdata/addon_data/$ADDON_NAME"
mkdir -p $ADDON_HOME
if [ ! -f "$ADDON_HOME/dvbhdhomerun.sample" ]; then
cp $ADDON_DIR/config/* $ADDON_HOME/
fi
export LD_LIBRARY_PATH=$ADDON_DIR/lib:$LD_LIBRARY_PATH
if [ -z "$(pidof userhdhomerun)" ]; then
rm -f /tmp/dvbhdhomerun
[ -f $ADDON_HOME/dvbhdhomerun ] && ln -s $ADDON_HOME/dvbhdhomerun /tmp/dvbhdhomerun
modprobe dvb_hdhomerun
modprobe dvb_hdhomerun_fe
mkdir -p /var/log/
rm -f /var/log/dvbhdhomerun.log
cd $ADDON_DIR/bin
userhdhomerun -f
sh $ADDON_HOME/userhdhomerun-started.sh >/dev/null 2>&1 &
(
sleep 3
sn_old="dummy"
[ -f $ADDON_HOME/serial-number.txt ] && sn_old=$(cat $ADDON_HOME/serial-number.txt)
sn_new=$(grep "Name of device: " /var/log/dvbhdhomerun.log)
if [ "$sn_new" != "$sn_old" ]; then
grep "Name of device: " /var/log/dvbhdhomerun.log >$ADDON_HOME/serial-number.txt
fi
)&
fi