gregklanderman wrote: > No problem! If you want to add a limit, you could do something like > this: > > > Code: -------------------- > > > count=10 # approx time limit in seconds > while ! pigs t >/dev/null 2>&1 ; do > if (( count-- <= 0 )) ; then > printf "\npigpiod failed to initialize within time limit\n" > exit 1 # or however you want to deal with failure > fi > # printf "\nWaiting for pigpiod to initialize\n" > sleep 1 > done > printf "\npigpiod is running\n" > -------------------- > >
I suspect there is a couple of errors in this line: if (( count-- <= 0 )) ; then We use "sh/ash" shell for piCorePlayer. Something like (not tested): if [ $((count--)) -le 0 ]; then ------------------------------------------------------------------------ Greg Erskine's Profile: http://forums.slimdevices.com/member.php?userid=7403 View this thread: http://forums.slimdevices.com/showthread.php?t=111502 _______________________________________________ unix mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/unix
