Greg Erskine wrote: 
> Is this a ash/sh Linux script?
> 
> Is this line OK?
> 
> if (( count-- <= 0 )) ; then

Apparently it's not ok.  I'm running this under pCP6-b9.  I changed my
script to look like this, so that that line is line 16:


Code:
--------------------
    #!/bin/sh
  
  # start pigpiod daemon
  pigpiod -t 0 -f -l -s 10
  
  # wait for pigpiod to initialize - indicated by 'pigs t' exit code of zero
  
  #while ! pigs t >/dev/null 2>&1 ; do
  #     printf "\nWaiting for pigpiod to initialize\n"
  #     sleep 1
  #done
  #printf "\npigpiod is running\n"
  
  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"
  .
  .
  .
  
--------------------


It gives these errors:

Code:
--------------------
    ./sbpd-script.sh: line 16: can't open =: no such file
  ./sbpd-script.sh: line 16: count--: not found
--------------------


------------------------------------------------------------------------
chill's Profile: http://forums.slimdevices.com/member.php?userid=10839
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