# XXX: better use lockfile (or something), but it's not in current firmware
test -e /tmp/op_power.lock && exit 2
touch /tmp/op_power.lock
+highpow="$(cat /etc/pandora/conf/led.conf | grep HighPowerLED: | awk -F\: '{print $2}')"
+lowpow="$(cat /etc/pandora/conf/led.conf | grep LowPowerLED: | awk -F\: '{print $2}')"
debug(){
return 1 # 0 when debugging, 1 when not
do
kill -CONT $PID
done
- echo 255 > /sys/class/leds/pandora\:\:power/brightness #power LED bright
+ echo $highpow > /sys/class/leds/pandora\:\:power/brightness #power LED bright
}
display_on_with_checks() {
# if we are here, either we already resumed or the suspend failed
if [ -n "$restore_list" ]; then
- modprobe $restore_list
+ for module in $restore_list; do
+ modprobe $module
+ done
fi
display_on
resume_net
- echo 255 > /sys/class/leds/pandora\:\:power/brightness
+ echo $highpow > /sys/class/leds/pandora\:\:power/brightness
# wait here a bit to prevent this script from running again (keep op_power.lock)
# in case user did resume using the power switch.
suspend_() {
# dim power LED
- echo 16 > /sys/class/leds/pandora\:\:power/brightness
+ echo $lowpow > /sys/class/leds/pandora\:\:power/brightness
if suspend_real; then
# resumed already