On Tue, Aug 20, 2013 at 1:20 AM, Manuel Reimer <manuel.reimer@xxxxxx> wrote:
NUMADAPTERS=3This works for *one* system and only if the user manually sets the number of adapters. How could this be done in a "automagic" way to allow users to just plug the tuner and reboot?while [[ `find /dev/dvb -name 'adapter*' | wc -l` -lt $NUMADAPTERS
]]; do sleep 1; done
runvdr ...
could be used to count the number of adapters, and check that number in
a loop
against the expected number of adapters.
I don't think you can automate that in a very reliable way, especially if you're using usb dvb devices and/or devices with field values that aren't set correctly. The only reliable way is to have the user define how many dvb devices are expected to init, and then wait for that to happen during boot. Something like:
dvbcount=3
until (($dvbcount == $(ls -d /dev/dvb/adapter* |wc -l))); do sleep 1; done
Additionally I would add a timeout if you plan on doing this during boot:
until (($dvbcount == $(ls -d /dev/dvb/adapter* |wc -l) || timeout == 0)); do sleep 1; ((timeout--)); done
dvbcount=3
timeout=60until (($dvbcount == $(ls -d /dev/dvb/adapter* |wc -l) || timeout == 0)); do sleep 1; ((timeout--)); done
_______________________________________________ vdr mailing list vdr@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr