diff options
author | Victor Lowther <victor.lowther@gmail.com> | 2008-09-10 22:04:04 -0500 |
---|---|---|
committer | Victor Lowther <victor.lowther@gmail.com> | 2008-09-10 22:04:04 -0500 |
commit | 285ed3d355956513ecb8509ef931860221aadd25 (patch) | |
tree | acafb4e05045d8a97dc6c3606427cbcbecb0a479 | |
parent | abcd57e9730613bf08d75498fa348266a93f49b0 (diff) |
Make 00auto-quirk fail gracefully if HAL is not there.
-rwxr-xr-x | pm/sleep.d/00auto-quirk | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pm/sleep.d/00auto-quirk b/pm/sleep.d/00auto-quirk index 7ac304c..b92aca4 100755 --- a/pm/sleep.d/00auto-quirk +++ b/pm/sleep.d/00auto-quirk @@ -46,12 +46,17 @@ do_save_quirks() echo "FDI file created as /tmp/pm-utils=created.fdi" } -mabye_add_quirks() +maybe_add_quirks() { [ -z "$PM_CMDLINE" ] && { + command_exists lshal || return $NA do_add_quirks return 0 } + command_exists lshal || { + echo "--auto-quirks requires HAL. Aborting" + return 1 + } has_parameter --auto-quirks || return 0 do_add_quirks remove_parameters --auto-quirks @@ -75,7 +80,7 @@ help() } case $1 in - suspend|hibernate) mabye_add_quirks ;; + suspend|hibernate) maybe_add_quirks ;; thaw|resume) maybe_save_quirks ;; help) help ;; *) exit $NA ;; |