paul- wrote:
> I simplified, and put some comments in the code for you......
>
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 deamon
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"
# load uinput module - required to be able to send keystrokes
.
.
.
--------------------
Works like a charm now, and the only out-of-sequence message is between
'Starting Jivelite...' and the corresponding 'Done'. The offending
'printf' (in bold above) could probably be removed from the script now,
as it was really only for debugging.
Code:
--------------------
.
.
.
Starting user commands... Done.
Setting CPU scaling governor to ondemand... Done.
Starting Jivelite...
WAITING FOR PIGPIOD TO INITIALIZE
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.
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
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix