Difference between revisions of "User Scripts"

From WikiDLXTV
Jump to: navigation, search
(Created page with 'The inner workings of WDLXTV can be modified by advanced users who wish to run their own shell script at boot time to either launch applications, or patch over a read-only file a…')
 
Line 1: Line 1:
 +
= About =
 
The inner workings of WDLXTV can be modified by advanced users who wish to run their own shell script at boot time to either launch applications, or patch over a read-only file and replace it with another file that they are providing.
 
The inner workings of WDLXTV can be modified by advanced users who wish to run their own shell script at boot time to either launch applications, or patch over a read-only file and replace it with another file that they are providing.
  
 
(WIP)
 
(WIP)
 +
 +
 +
= Scripts run from USB =
 +
== S00custom-options ==
 +
Have a look [[S00custom-options|here]] for a list of available config settings.<br>
 +
=== Example script ===
 +
This script will change the background image back to the WD default background.
 +
#!/bin/sh
 +
config_tool -c BACKGROUND_IMAGE=original_bg.jpg
 +
 +
 +
= Scripts run from /conf =
 +
== S00user-script ==
 +
=== Example script ===
 +
This script does does the following:
 +
* Write a start message to ''/tmp/messages.txt''
 +
* sleep for 1 second
 +
* Write an end message to ''/tmp/messages.txt''
 +
#!/bin/sh
 +
logger -t "S00user-script" -p notice "start"
 +
sleep 1
 +
logger -t "S00user-script" -p notice "end"
 +
 +
 +
== S99user-script ==
 +
This script does does the following:
 +
* Write a start message to ''/tmp/messages.txt''
 +
* sleep for 1 second
 +
* Write an end message to ''/tmp/messages.txt''
 +
#!/bin/sh
 +
logger -t "S99user-script" -p notice "start"
 +
sleep 1
 +
logger -t "S99user-script" -p notice "end"
 +
 +
 +
= Links =
 +
* [http://www.freeos.com/guides/lsst/index.html Linux Shell Scripting Tutorial - A Beginner's handbook]

Revision as of 10:18, 14 July 2011

About

The inner workings of WDLXTV can be modified by advanced users who wish to run their own shell script at boot time to either launch applications, or patch over a read-only file and replace it with another file that they are providing.

(WIP)


Scripts run from USB

S00custom-options

Have a look here for a list of available config settings.

Example script

This script will change the background image back to the WD default background.

#!/bin/sh
config_tool -c BACKGROUND_IMAGE=original_bg.jpg


Scripts run from /conf

S00user-script

Example script

This script does does the following:

  • Write a start message to /tmp/messages.txt
  • sleep for 1 second
  • Write an end message to /tmp/messages.txt
#!/bin/sh
logger -t "S00user-script" -p notice "start"
sleep 1
logger -t "S00user-script" -p notice "end"


S99user-script

This script does does the following:

  • Write a start message to /tmp/messages.txt
  • sleep for 1 second
  • Write an end message to /tmp/messages.txt
#!/bin/sh
logger -t "S99user-script" -p notice "start"
sleep 1
logger -t "S99user-script" -p notice "end"


Links