summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/on_ac_power6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/on_ac_power b/src/on_ac_power
index 6f6a3d0..edddf72 100755
--- a/src/on_ac_power
+++ b/src/on_ac_power
@@ -31,7 +31,7 @@
#
# Check for AC/DC/etc adapters
-ac_adapters=$(hal-find-by-capability --capability ac_adapter)
+ac_adapters="$(hal-find-by-capability --capability ac_adapter)"
# If there are no AC adapters, it is most likely a desktop.
# Assume online, since we have no data.
@@ -39,8 +39,8 @@ ac_adapters=$(hal-find-by-capability --capability ac_adapter)
# If any of them are online, then we're done.
for device in $ac_adapters ; do
- present=$(hal-get-property --udi "$device" --key ac_adapter.present)
- [ "x$present" = "xtrue" ] && exit 0
+ present="$(hal-get-property --udi "$device" --key ac_adapter.present)"
+ [ "$present" = "true" ] && exit 0
done
# If there are adapters, but none are online, we're not on AC.