op_osupgrade: add some sanity checks
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / op_bright_up.sh
1 #!/bin/bash
2
3 . /usr/pandora/scripts/op_paths.sh
4
5 cur=$(cat $SYSFS_BACKLIGHT_BRIGHTNESS)
6 max=$(cat $SYSFS_BACKLIGHT/max_brightness)
7
8 if [ "$cur" -gt "35" ]; then
9    new=$(($cur+10))
10 elif [ "$cur" -gt "20" ]; then 
11    new=$(($cur+7))
12 elif [ "$cur" -gt "13" ]; then 
13    new=$(($cur+5))
14 elif [ "$cur" -gt "5" ]; then 
15    new=$(($cur+3))
16 elif [ "$cur" -gt "0" ]; then 
17    new=$(($cur+1))
18 elif [ "$cur" -eq "0" ]; then 
19    new=3
20 fi
21
22 if [ "$new" -gt "$max" ]; then
23    new=$max
24 fi
25
26 # make sure we are not blanking (sometimes screensaver fails to unblank?)
27 echo 0 > /sys/class/graphics/fb0/blank
28
29 echo $new > $SYSFS_BACKLIGHT_BRIGHTNESS