diff options
author | Richard Hughes <richard@hughsie.com> | 2007-12-29 11:58:18 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2007-12-29 11:58:18 +0000 |
commit | a1e346dd88820b75f0e8d28f3c9ffb9b3604e4cf (patch) | |
tree | 3b6672936e1ab6c7bb519c61cdb66be78355a968 /pm/functions | |
parent | d2d72cb5c174e0873530773a1e371c2310809c6b (diff) |
2007-12-29 Richard Hughes <richard@hughsie.com>
* pm/functions:
* src/pm-powersave:
Red Hat Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=302401
(Issue 2 in the bug report)
Without the uniq files in the sleep.d or power.d directory may run twice.
Also this patch removes a uneccessary -e test in the if statements, the
-x test already includes a -e test.
Also this patch adds a modeline for vim no to expand tabs, because tabs are
used in the files for indentation.
From Till Maas <opensource@till.name>, many thanks.
Diffstat (limited to 'pm/functions')
-rwxr-xr-x | pm/functions | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pm/functions b/pm/functions index b40dd55..39872e3 100755 --- a/pm/functions +++ b/pm/functions @@ -1,4 +1,5 @@ #!/bin/bash +# vim:noexpandtab export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/pm-utils/bin @@ -62,12 +63,10 @@ remove_suspend_lock() find_sleepd_files() { flist="/etc/pm/sleep.d/*[^~] /usr/lib/pm-utils/sleep.d/*[^~]" - bases=$(for file in $flist ; do echo $(basename $file) ; done | sort -n) + bases=$(for file in $flist ; do echo $(basename $file) ; done | sort -n | uniq) for base in $bases ; do - if [ -e "/etc/pm/sleep.d/$base" ]; then - if [ -x "/etc/pm/sleep.d/$base" ]; then - echo /etc/pm/sleep.d/$base - fi + if [ -x "/etc/pm/sleep.d/$base" ]; then + echo /etc/pm/sleep.d/$base elif [ -x "/usr/lib/pm-utils/sleep.d/$base" ]; then echo /usr/lib/pm-utils/sleep.d/$base fi |