Difference between revisions of "User Scripts"

From WikiDLXTV
Jump to: navigation, search
Line 28: Line 28:
  
 
== S99user-script ==
 
== S99user-script ==
 +
=== Example script ===
 
This script does does the following:
 
This script does does the following:
 
* Write a start message to ''/tmp/messages.txt''
 
* Write a start message to ''/tmp/messages.txt''

Revision as of 10:22, 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

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 "S99user-script" -p notice "start"
sleep 1
logger -t "S99user-script" -p notice "end"


Links