Ducktrick
Super Elite User
wer lust und zeit hat den bitte ich mal das script zu testen. alles aus der code box in eine z.b /tmp/test.sh kopieren und diese zwei befehle ausführen
danach sollte euch das script boxtype und tuner ausgeben
das script...
Code:
chmod 755 /tmp/test.sh
/tmp/test.sh
danach sollte euch das script boxtype und tuner ausgeben
das script...
Code:
# Tuner Autodetect skript
# Anhand der vorhandenen I2C Adressen ermitteln wir den Boxtype für den Tuner
# beginnen wir die Adressen zu checken die da sein müssen
echo "Tuner Scan" > /dev/vfd
echo "Check Bus=2 Boxtype I2C"
/bin/i2cget -y 2 0x40 > /tmp/40
/bin/i2cget -y 2 0x28 > /tmp/28
echo "Done..."
# jetzt lesen wir die werte
I2C40=`cat /tmp/40`
I2C28=`cat /tmp/28`
sleep 1
# diese adressen geben bei i2cget entwerden 0x00 oder 0x13 aus
if [ "$I2C40" = "" ]; then
echo "Bus=2 Addr=0x40 Request = ERROR NOT FOUND"
I2C40OK=error
else
echo "Bus=2 Addr=0x40 Request = OK"
I2C40OK=found
fi
if [ "$I2C28" = "" ]; then
echo "Bus=2 Addr=0x28 Request = ERROR NOT FOUND"
I2C28OK=error
else
echo "Bus=2 Addr=0x28 Request = OK"
I2C28OK=found
fi
sleep 3
# Bis hierher alles bestens, nun definieren wir was in falle von OK Passieren soll
if [ $I2C40OK = found ]; then
# ist 40 ok checken wir ob auch 28 da ist ( für vip1v2 )
if [ $I2C28OK = found ]; then
echo "vip1v2" > /var/config/system/tunerboxtype
echo "VIP1v2..."
echo "VIP1v2..." > /dev/vfd
sleep 3
else
echo "vip1" > /var/config/system/tunerboxtype
echo "VIP1..."
echo "VIP1..." > /dev/vfd
sleep 3
fi
elif [ $I2C28OK = found ]; then
echo "vip2" > /var/config/system/tunerboxtype
echo "VIP2..."
echo "VIP2..." > /dev/vfd
sleep 3
fi
# Ab hier machen wir das Spiel von vorn für den Tuner i2c
BOXTYPE=`cat /var/config/system/tunerboxtype`
echo "Initialisierter Boxtype=$BOXTYPE"
sleep 1
if [ $BOXTYPE = vip1 ]; then
# Single Tuner Check
echo "I2C Tuner Check ...."
/bin/i2cget -y 0 0x68 > /tmp/068
sleep 1
/bin/i2cget -y 0 0x6a > /tmp/06a
sleep 1
/bin/i2cget -y 0 0x0f > /tmp/00f
sleep 1
/bin/i2cget -y 0 0x0c > /tmp/00c
sleep 1
echo "Done...Ignoriere alle Fehler"
# Bus=0 Addr=0x68 request check ST-Tuner
I2C068=`cat /tmp/068`
sleep 1
if [ "$I2C068" = "" ]; then
echo "Bus=0 addr=0x68, ST-Tuner, Request = ERROR NOT FOUND"
T1ST=error
else
echo "Bus=0 addr=0x68, ST-Tuner, Request = OK"
T1ST=found
fi
# Bus=0 Addr=0x6a request check RB
I2C06A=`cat /tmp/06a`
sleep 1
if [ "$I2C06A" = "" ]; then
echo "Bus=0 addr=0x6a, RB-Tuner, Request = ERROR NOT FOUND"
T1RB=error
else
echo "Bus=0 addr=0x6a, RB-Tuner, Request = OK"
T1RB=found
fi
# Bus=0 Addr=0x0f request check DVB-T
I2C00f=`cat /tmp/00f`
sleep 1
if [ "$I2C00f" = "" ]; then
echo "Bus=0 addr=0x0f, DVB-T, Request = ERROR NOT FOUND"
T1DVBT=error
else
echo "Bus=0 addr=0x0f, DVB-T, Request = OK"
T1DVBT=found
fi
# Bus=0 Addr=0x0c request check LG
I2C00C=`cat /tmp/00c`
sleep 1
if [ "$I2C00C" = "" ]; then
echo "Bus=0 addr=0x0c, LG031, Request = ERROR NOT FOUND"
T1LG=error
else
echo "Bus=0 addr=0x0c, LG031, Request = ERROR NOT FOUND"
T1LG=found
fi
###################################################
if [ "$T1ST" = "found" ]; then
echo "Bus 0 - ST-Tuner detect..."
# Aktiviert vip1v2 Sharp tuner in der rcS
echo "stb6110x" > /var/keys/Benutzerdaten/.system/tuner1
echo "ST-Tuner..." > /dev/vfd
echo "ST-Tuner..."
echo "Setze $BOXTYPE ST-Tuner..."
sleep 7
elif [ "$T1RB" = "found" ]; then
echo "Bus 0 - RB-Tuner detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "stb6100" > /var/keys/Benutzerdaten/.system/tuner1
echo "RB-Tuner..." > /dev/vfd
echo "Setze $BOXTYPE RB-Tuner..."
sleep 7
elif [ "$T1DVBT" = "found" ]; then
echo "Bus 0 - Tuner Sharp DVB-T detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "sharp6465" > /var/keys/Benutzerdaten/.system/tuner1
echo "Sharp DVB-T..." > /dev/vfd
echo "Setze $BOXTYPE Sharp DVB-T..."
sleep 7
elif [ "$T1LG" = "found" ]; then
echo "Bus 0 - Tuner LG Kabel detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "lg031" > /var/keys/Benutzerdaten/.system/tuner1
echo "T2 DVB-C" > /dev/vfd
echo "Setze $BOXTYPE LG Kabel..."
sleep 7
fi
elif [ $BOXTYPE = vip1v2 ]; then
# Single Tuner Check
echo "I2C Tuner Check ...."
/bin/i2cget -y 0 0x68 > /tmp/068
sleep 1
/bin/i2cget -y 0 0x0f > /tmp/00f
sleep 1
/bin/i2cget -y 0 0x0c > /tmp/00c
sleep 1
echo "Done..."
# Bus=0 Addr=0x68 request check Sharp7306
I2C068=`cat /tmp/068`
sleep 1
if [ "$I2C068" = "" ]; then
echo "Bus=0 addr=0x68, Sharp7306, Request = ERROR NOT FOUND"
T1SHARP7306=error
else
echo "Bus=0 addr=0x68, Sharp7306, Request = OK"
T1SHARP7306=found
fi
# Bus=0 Addr=0x0f request check DVB-T
I2C00f=`cat /tmp/00f`
sleep 1
if [ "$I2C00f" = "" ]; then
echo "Bus=0 addr=0x0f, DVB-T, Request = ERROR NOT FOUND"
T1DVBT=error
else
echo "Bus=0 addr=0x0f, DVB-T, Request = OK"
T1DVBT=found
fi
# Bus=0 Addr=0x0c request check LG
I2C00C=`cat /tmp/00c`
sleep 1
if [ "$I2C00C" = "" ]; then
echo "Bus=0 addr=0x0c, LG031, Request = ERROR NOT FOUND"
T1LG=error
else
echo "Bus=0 addr=0x0c, LG031, Request = ERROR NOT FOUND"
T1LG=found
fi
##########################################
if [ "$T1SHARP7306" = "found" ]; then
echo "Bus 0 - Tuner Sharp S2 detect..."
# Aktiviert vip1v2 Sharp tuner in der rcS
echo "sharp7306" > /var/keys/Benutzerdaten/.system/tuner1
echo "Sharp S2..." > /dev/vfd
echo "Sharp S2..."
echo "Setze $BOXTYPE Sharp S2..."
sleep 7
elif [ "$T1DVBT" = "found" ]; then
echo "Bus 0 - Tuner Sharp DVB-T detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "sharp6465" > /var/keys/Benutzerdaten/.system/tuner1
echo "Sharp DVB-T..." > /dev/vfd
echo "Setze $BOXTYPE Sharp DVB-T..."
sleep 7
elif [ "$T1LG" = "found" ]; then
echo "Bus 0 - Tuner LG Kabel detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "lg031" > /var/keys/Benutzerdaten/.system/tuner1
echo "T2 DVB-C" > /dev/vfd
echo "Setze $BOXTYPE LG Kabel..."
sleep 7
fi
elif [ $BOXTYPE = vip2 ]; then
# Dual Tuner Check
# sharp bus 0 und bus 1 Check
echo "I2C Tuner Check ...."
/bin/i2cget -y 0 0x68 > /tmp/068
sleep 1
/bin/i2cget -y 1 0x68 > /tmp/168
sleep 1
/bin/i2cget -y 1 0x0f > /tmp/10f
sleep 1
/bin/i2cget -y 0 0x0f > /tmp/00f
sleep 1
/bin/i2cget -y 1 0x0c > /tmp/10c
sleep 1
/bin/i2cget -y 0 0x0c > /tmp/00c
sleep 1
echo "Done..."
# Bus=0 Addr=0x68 request check Sharp7306
I2C068=`cat /tmp/068`
sleep 1
if [ "$I2C068" = "" ]; then
echo "Bus=0 addr=0x68, Sharp7306, Request = ERROR NOT FOUND"
T1SHARP7306=error
else
echo "Bus=0 addr=0x68, Sharp7306, Request = OK"
T1SHARP7306=found
fi
# Bus=1 Addr=0x68 request check Sharp7306
I2C168=`cat /tmp/168`
sleep 1
if [ "$I2C168" = "" ]; then
echo "Bus=1 addr=0x68, Sharp7306, Request = ERROR NOT FOUND"
T2SHARP7306=error
else
echo "Bus=1 addr=0x68, Sharp7306, Request = OK"
T2SHARP7306=found
fi
# Bus=0 Addr=0x0f request check DVB-T
I2C00f=`cat /tmp/00f`
sleep 1
if [ "$I2C00f" = "" ]; then
echo "Bus=0 addr=0x0f, DVB-T, Request = ERROR NOT FOUND"
T1DVBT=error
else
echo "Bus=0 addr=0x0f, DVB-T, Request = OK"
T1DVBT=found
fi
# Bus=1 Addr=0x0f request check DVB-T
I2C10f=`cat /tmp/10f`
sleep 1
if [ "$I2C10f" = "" ]; then
echo "Bus=1 addr=0x0f, DVB-T, Request = ERROR NOT FOUND"
T2DVBT=error
else
echo "Bus=1 addr=0x0f, DVB-T, Request = OK"
T2DVBT=found
fi
# Bus=0 Addr=0x0c request check LG
I2C00C=`cat /tmp/00c`
sleep 1
if [ "$I2C00C" = "" ]; then
echo "Bus=0 addr=0x0c, LG031, Request = ERROR NOT FOUND"
T1LG=error
else
echo "Bus=0 addr=0x0c, LG031, Request = OK"
T1LG=found
fi
# Bus=1 Addr=0x0c request check LG
I2C10C=`cat /tmp/10c`
sleep 1
if [ "$I2C10C" = "" ]; then
echo "Bus=1 addr=0x0c, LG031, Request = ERROR NOT FOUND"
T2LG=error
else
echo "Bus=1 addr=0x0c, LG031, Request = OK"
T2LG=found
fi
######################################
if [ "$T1SHARP7306" = "found" ]; then
echo "Bus 0 - Tuner Sharp S2 detect..."
echo "T1 DVB-S2" > /dev/vfd
echo "sharp7306" > /var/keys/Benutzerdaten/.system/tuner1
sleep 5
if [ "$T2SHARP7306" = "found" ]; then
echo "Bus 1 - Tuner Sharp S2 detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "sharp7306" > /var/keys/Benutzerdaten/.system/tuner2
echo "T2 DVB-S2" > /dev/vfd
echo "Setze $BOXTYPE Sharp S2 Dual..."
sleep 7
elif [ "$T2DVBT" = "found" ]; then
echo "Bus 1 - Tuner Sharp DVB-T detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "sharp6465" > /var/keys/Benutzerdaten/.system/tuner2
echo "T2 DVB-T" > /dev/vfd
echo "Setze $BOXTYPE Sharp S2 + Sharp DVB-T..."
sleep 7
elif [ "$T2LG" = "found" ]; then
echo "Bus 1 - Tuner LG Kabel detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "lg031" > /var/keys/Benutzerdaten/.system/tuner2
echo "T2 DVB-C" > /dev/vfd
echo "Setze $BOXTYPE Sharp S2 + LG Kabel..."
sleep 7
fi
elif [ "$T1DVBT" = "found" ]; then
echo "Bus 0 - Tuner Sharp DVB-T detect..."
echo "T1 DVB-T" > /dev/vfd
echo "sharp6465" > /var/keys/Benutzerdaten/.system/tuner1
sleep 5
if [ "$T2DVBT" = "found" ]; then
echo "Bus 1 - Tuner Sharp DVB-T detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "sharp6465" > /var/keys/Benutzerdaten/.system/tuner2
echo "T2 DVB-T" > /dev/vfd
echo "Setze $BOXTYPE Sharp S2 + Sharp DVB-T..."
sleep 7
elif [ "$T2SHARP7306" = "found" ]; then
echo "Bus 1 - Tuner Sharp S2 detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "sharp7306" > /var/keys/Benutzerdaten/.system/tuner2
echo "T2 DVB-S2" > /dev/vfd
echo "Setze $BOXTYPE Sharp DVB-T + Sharp S2..."
sleep 7
elif [ "$T2LG" = "found" ]; then
echo "Bus 1 - Tuner LG Kabel detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "lg031" > /var/keys/Benutzerdaten/.system/tuner2
echo "T2 DVB-C" > /dev/vfd
echo "Setze $BOXTYPE Sharp S2 + LG Kabel..."
sleep 7
fi
elif [ "$T1LG" = "found" ]; then
echo "Bus 0 - Tuner Sharp DVB-T detect..."
echo "T1 DVB-C" > /dev/vfd
echo "lg031" > /var/keys/Benutzerdaten/.system/tuner1
sleep 5
if [ "$T2DVBT" = "found" ]; then
echo "Bus 1 - Tuner Sharp DVB-T detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "sharp6465" > /var/keys/Benutzerdaten/.system/tuner2
echo "T2 DVB-T" > /dev/vfd
echo "Setze $BOXTYPE Sharp DVB-T + Sharp DVB-T..."
sleep 7
elif [ "$T2SHARP7306" = "found" ]; then
echo "Bus 1 - Tuner Sharp S2 detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "sharp7306" > /var/keys/Benutzerdaten/.system/tuner2
echo "T2 DVB-S2" > /dev/vfd
echo "Setze $BOXTYPE Sharp DVB-T + Sharp S2..."
sleep 7
elif [ "$T2LG" = "found" ]; then
echo "Bus 1 - Tuner LG Kabel detect..."
# Aktiviert in der rcS den Dual sharp Treiber
echo "lg031" > /var/keys/Benutzerdaten/.system/tuner2
echo "T2 DVB-C" > /dev/vfd
echo "Setze $BOXTYPE Sharp DVB-T + LG Kabel..."
sleep 7
fi
fi
fi
if [ $BOXTYPE = vip1 ]; then
TUNER1=`cat /var/keys/Benutzerdaten/.system/tuner1`
sleep 1
if [ "$TUNER1" = "sharp6465" ]; then
echo "ce6353" > /var/keys/Benutzerdaten/.system/demod1
elif [ "$TUNER1" = "stb6110x" ]; then
echo "stb090x" > /var/keys/Benutzerdaten/.system/demod1
elif [ "$TUNER1" = "lg031" ]; then
echo "tda10023" > /var/keys/Benutzerdaten/.system/demod1
elif [ "$TUNER1" = "stb6100" ]; then
echo "stb0899" > /var/keys/Benutzerdaten/.system/demod1
fi
DEMOD1=`cat /var/keys/Benutzerdaten/.system/demod1`
echo "erstelle demod=$DEMOD1 tuner=$TUNER1"
elif [ $BOXTYPE = vip1v2 ]; then
TUNER1=`cat /var/keys/Benutzerdaten/.system/tuner1`
sleep 1
if [ "$TUNER1" = "sharp6465" ]; then
echo "ce6353" > /var/keys/Benutzerdaten/.system/demod1
elif [ "$TUNER1" = "sharp7306" ]; then
echo "stv090x" > /var/keys/Benutzerdaten/.system/demod1
elif [ "$TUNER1" = "lg031" ]; then
echo "tda10023" > /var/keys/Benutzerdaten/.system/demod1
fi
DEMOD1=`cat /var/keys/Benutzerdaten/.system/demod1`
echo "erstelle demod=$DEMOD1 tuner=$TUNER1"
elif [ $BOXTYPE = vip2 ]; then
TUNER1=`cat /var/keys/Benutzerdaten/.system/tuner1`
sleep 1
if [ "$TUNER1" = "sharp6465" ]; then
echo "ce6353" > /var/keys/Benutzerdaten/.system/demod1
elif [ "$TUNER1" = "sharp7306" ]; then
echo "stv090x" > /var/keys/Benutzerdaten/.system/demod1
elif [ "$TUNER1" = "lg031" ]; then
echo "tda10023" > /var/keys/Benutzerdaten/.system/demod1
fi
TUNER2=`cat /var/keys/Benutzerdaten/.system/tuner2`
sleep 1
if [ "$TUNER2" = "sharp6465" ]; then
echo "ce6353" > /var/keys/Benutzerdaten/.system/demod2
elif [ "$TUNER2" = "sharp7306" ]; then
echo "stv090x" > /var/keys/Benutzerdaten/.system/demod2
elif [ "$TUNER2" = "lg031" ]; then
echo "tda10023" > /var/keys/Benutzerdaten/.system/demod2
fi
DEMOD1=`cat /var/keys/Benutzerdaten/.system/demod1`
DEMOD2=`cat /var/keys/Benutzerdaten/.system/demod2`
echo "erstelle demod1=$DEMOD1 tuner1=$TUNER1 demod2=$DEMOD2 tuner2=$TUNER2"
echo "FERTIG" > /dev/vfd
fi
Zuletzt bearbeitet: