chill wrote: 
> Marvellous - thanks Paul.
> 
> I removed an unnecessary output, added some 'new lines', and tidied up
> the comments so that it better reflects how it works.
> 
> > 
Code:
--------------------
  >   > #!/bin/sh
  > 
  > # start pigpiod daemon
  > pigpiod -t 0
  > 
  > # wait for pigpiod to initialize - indicated by 'pigs t' exit code of zero
  > 
  > PIGI=0
  > while [ $PIGI -eq 0 ]
  > do
  >     pigs t >/dev/null 2>&1
  >     if [ $? -eq 0 ]; then
  >             PIGI=1
  >     else
  > #           PRINTF \"\NWAITING FOR PIGPIOD TO INITIALIZE\N\"
  >             sleep 1
  >     fi
  > done
  > printf "\npigpiod is running\n"
  > 
  > .....
  > 
--------------------
> > 
> 

FWIW you should be able to simplify that loop to


Code:
--------------------
    
  while ! pigs t >/dev/null 2>&1 ; do
  #    printf "\nWaiting for pigpiod to initialize\n"
  sleep 1
  done
  printf "\npigpiod is running\n"
  
--------------------


------------------------------------------------------------------------
gregklanderman's Profile: http://forums.slimdevices.com/member.php?userid=3524
View this thread: http://forums.slimdevices.com/showthread.php?t=111502

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to