diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2007-01-04 23:15:45 +0000 |
---|---|---|
committer | Matthias Schwarzott <zzam@gentoo.org> | 2007-01-04 23:15:45 +0000 |
commit | 59decda89473ab5195eeb38c3912dcc79f0cc9f8 (patch) | |
tree | d547ac54fa8ef8612322f671801a2ced26cbd1e6 /README.shutdown | |
parent | Updated TODO-file. (diff) | |
download | gentoo-vdr-scripts-59decda89473ab5195eeb38c3912dcc79f0cc9f8.tar.gz gentoo-vdr-scripts-59decda89473ab5195eeb38c3912dcc79f0cc9f8.tar.bz2 gentoo-vdr-scripts-59decda89473ab5195eeb38c3912dcc79f0cc9f8.zip |
Removed using a variable for return-values (SHUTDOWN_EXITCODE). Renamed function set_wakeup to wakeup_set. Added function wakeup_check.
svn path=/gentoo-vdr-scripts/trunk/; revision=370
Diffstat (limited to 'README.shutdown')
-rw-r--r-- | README.shutdown | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/README.shutdown b/README.shutdown index 4d8316e..4eca735 100644 --- a/README.shutdown +++ b/README.shutdown @@ -19,34 +19,50 @@ The module is sourced by the bash. The wakeup-module is executed as user root. The Main part of the wakeup-module: -The main part (executed when sourcing) should only check weather a shutdown with this module is possible. -i.e. check for existence of used programms ... +A wakeup-module should do nothing in its main part. -Usable functions: -void error_mesg(string message) - Sets an error message +Return values of functions: + == 0 - success + <> 0 - failure -Output variables: - SHUTDOWN_EXITCODE - When set to nonzero this means shutdown/setting wakeup time is not possible +Functions to be defined: -Example: +wakeup_check: + Should return 0 when setting wakeup is possible + else it should return a non-zero return value + and set an error-message. + i.e. check for existence of used programms ... -if [[ ! -x needed_program ]]; then - error_mesg "no acpi-driver installed" - SHUTDOWN_EXITCODE=1 -fi +set_wakeup: + Do the real work. It gets the time to wakeup as + first parameter and should do whatever necessary + to let the system be up at that time. -The function set_wakeup: +Usable functions: + +void error_mesg(string message) + Sets an error message -set_wakeup() -{ - # add code here + +Example: + +wakeup_check() { + if [[ ! -x needed_program ]]; then + error_mesg "no acpi-driver installed" + return 1 + fi + + return 0 +} + +wakeup_set() { + pass_wakeup_time_to_hardware "${1}" } Usable functions: @@ -60,9 +76,6 @@ void set_reboot_needed(void) Input Variables: VDR_WAKEUP_TIME - Time to wakeup in Unix-Format (Seconds since 1970-01-01 UTC) -Output Variables: - SHUTDOWN_EXITCODE - For signaling that wakeup-time could not be set - ===================== = pre-shutdown-hooks: |