On Tue, Aug 20, 2013 at 1:20 AM, Manuel Reimer <manuel.rei...@gmx.de> wrote:
> NUMADAPTERS=3 > >> 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. >> > > This 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? > 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: dvbcount=3 timeout=60 until (($dvbcount == $(ls -d /dev/dvb/adapter* |wc -l) || timeout == 0)); do sleep 1; ((timeout--)); done
_______________________________________________ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr