Difference between revisions of "S99user-script"
(Initial release) |
m |
||
(One intermediate revision by one other user not shown) | |||
Line 11: | Line 11: | ||
Using a text editor of your choice you can edit the file and add the commands you need inside. The first line of the script '''MUST''' be the following: | Using a text editor of your choice you can edit the file and add the commands you need inside. The first line of the script '''MUST''' be the following: | ||
− | #!/bin/ | + | #!/bin/sh |
Recommended command line text editors are [http://tuxradar.com/content/text-editing-nano-made-easy nano] or [http://www.unix-manuals.com/tutorials/vi/vi-in-10-1.html vi] | Recommended command line text editors are [http://tuxradar.com/content/text-editing-nano-made-easy nano] or [http://www.unix-manuals.com/tutorials/vi/vi-in-10-1.html vi] |
Latest revision as of 14:17, 16 October 2011
What does it do?
The /conf/S99user-script is a Bash script that is automatically run at the end of the firmware boot. You can include in it commands that will be executed on system startup.
How to create
The /conf/S99user-script is a user-created file, inside the persistent /conf partition on your WDTV. It does not come with the firmware and needs to be created if it is necessary.
Run the commands below through telnet/ssh on your wdtv to create it (the commands and names are case sensitive!):
touch /conf/S99user-script chmod a+x /conf/S99user-script config_tool -s; config_tool -s
Using a text editor of your choice you can edit the file and add the commands you need inside. The first line of the script MUST be the following:
#!/bin/sh
Recommended command line text editors are nano or vi
Example script
The following S99user-script will update your youtube-subscription cache on startup
#!/bin/sh # update youtube subscriptions - delay with 30s! (sleep 30; /usr/bin/php5-cgi /tmp/umsp-plugins/youtube-subscriptions/youtube-subscriptions-helper.php --insecure > /tmp/youtube-subscriptions.txt 2>&1)&