chill wrote: 
> 
> * Aargh - I've just noticed that the modified sbpd script is creating a
> file called '0' in the root folder - evidently something to do with that
> 'while ! [ $(pigs t) > '0' ] ' line, but my scripting isn't up to fixing
> that right now!

Ugh - I'm struggling with this.  The file called '0' was a result of
incorrectly using '>' instead of '-gt' (I'm surprised it worked at all),
but when I changed it to '-gt' it just caused another error, and I've
been chasing round in circles for ages.

But eventually I have a working version that solves this.  It's rather
clunky in my opinion, and I'm sure a more competent scripter can improve
it.  In particular, the output from this is getting jumbled up with the
other log file output, and is making it a bit confusing.  Some of the
'Done's are appearing against the wrong item.  And output from my script
is appearing against the Jivelite startup to give the misleading message
"Starting Jivelite...socket connect failed".  And I can't suppress that
'socket connect failed' due to the way I'm using 'echo' to get output
from 'pigs t'.  So can anyone help me do this properly ?

Here's my latest version:

Code:
--------------------
    #!/bin/sh
  
  # start pigpiod deamon
  pigpiod -t 0
  
  # wait for pigpiod to initialise - indicated by 'pigs t' returning a numeric 
value.  Returns 'socket connect failed' otherwise
  pigi=0
  while [ $pigi -eq 0 ]
  do
        printf "\npigpiod initialisation: "
        pigis=$(echo $(echo $(pigs t) | grep -o '[[:digit:]]*'))
        if [ "$pigis" != "" ]; then
                pigi=1
        else
                printf "\nWaiting for pigpiod to initialise"
                sleep 1
        fi
  done
  echo "pigpiod is running"
  
  # load uinput module - required to be able to send keystrokes
  .
  .
  .
--------------------


Here's the confusing output in the log file - my output is highlighted
in bold.

Code:
--------------------
    .
  .
  .
  Setting CPU scaling governor to ondemand
  PIGPIOD INITIALISATION: [/B]... DONE.
  STARTING JIVELITE...*SOCKET CONNECT FAILED
  
  WAITING FOR PIGPIOD TO INITIALISE* DONE.
  LOADING KEYTABLES... DONE.
  CREATING STATIC FOOTER... DONE.
  
  FINISHED PICOREPLAYER V6.0.0-B7 STARTUP.
  
  TO SETUP PICOREPLAYER, USE THE WEB INTERFACE VIA A BROWSER:
  - HTTP://192.168.1.48
  
  PRESS [ENTER] TO ACCESS CONSOLE.
  
  IN THE BACKGROUND, NTPD IS SYNCING TIME BETWEEN PICOREPLAYER AND THE INTERNET.
  A LARGE OFFSET BETWEEN 1970 AND NOW IS NORMAL.
  
  [B]PIGPIOD INITIALISATION: PIGPIOD IS RUNNING
  .
  .
  .
--------------------


------------------------------------------------------------------------
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
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to