Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DVB scripts



Hi all

    I am an EON user.. and of course like the rest of us I had some
problems with the drivers and the transponders. So there for I made 3
silly scripts that help to continue in this situation.

    So... here they are:


dvb-up  - it replaces the make insmod plus after that it runs CyberLogin
in background

#!/bin/sh

echo "Initializing dvb modules";
    cd ./driver/
    insmod -s i2c-core.o;
    insmod -s videodev.o;              \
    insmod -s saa7146_core.o mode=0;   \
    insmod -s saa7146_v4l.o;           \
    insmod -s VES1893.o;               \
    insmod -s VES1820.o;               \
    insmod -s dvb.o;                   \
    insmod -s tuner.o;                 \
    insmod -s msp3400.o;               \
    ifconfig dvb0 192.168.4.1;      \

echo "Logging to EON"
    cd ../apps/CyberLogin
    nohup "./CyberLogin"




dvb-down - it kills CyberLogin from background and removes the modules
from memory

#!/bin/sh

echo "Logging out from EON"
    killall -TERM CyberLogin

echo "Removing dvb modules";
    cd ./driver
    ifconfig dvb0 down;     \
    rmmod -s msp3400;          \
    rmmod -s tuner;            \
    rmmod -s dvb;              \
    rmmod -s VES1893;          \
    rmmod -s VES1820;          \
    rmmod -s saa7146_v4l;      \
    rmmod -s saa7146_core;     \
    rmmod -s videodev;         \
    rmmod -s i2c-core;         \



dvbd.pl - the script that controls these two;  It checks if you have
upload, and if you do is starts the dvb-up. If the dvb fall down it
starts dvb-down and tries to reinstall the drivers

#!/usr/bin/perl

    my $i;

    print "Start\n";
    while (3>2)
        { $i = upload_up();
          if($i == 0) {print "Upload down!!!";}
          while ($i == 0) {print "Waiting upload to go up\n"; $i =
upload_up();}
          print "Upload up!!!\n";
          system ("./dvb-up &");
          print "Waiting for the dvb to go up\n";
          sleep 40;
          $i = dvb_up();
          if($i == 1) {print "Dvb up!!!\n";}
          while ($i == 1) {$i = dvb_up();}
          print "Dvb down!!!\n";
          system ("./dvb-down");
          sleep 20;
        }

sub dvb_up
{
    $_ = qx{ping -c 1 -q -n 194.177.32.36};
    if(/.*\s(\d+)\% packet loss.*/)
       {if($1 == 0)     {return 1}
        else            {return 0}
       }

}

sub upload_up
{
    $_ = qx{ping -c 1 -q -n 194.177.32.35};
    if(/.*\s(\d+)\% packet loss.*/)
       {if($1 == 0)     {return 1}
        else            {return 0}
       }

}


NOTE: the scripts must be placed in the DVB directory near ./driver and
./apps ; Otherwise you'll have to change the path in the scripts

    I'm waiting for suggestions

Best Regards
Rares



Home | Main Index | Thread Index