Hi forumers, how are you doin..
I need help with my script...basically its a startup script for android. here's the script that i can confirm it works properly
AWAKE_GOVERNOR="conservative"
SLEEP_GOVERNOR="conservativeX"
(while [ 1 ]
do
AWAKE=`cat /sys/power/wait_for_fb_wake`
if [ $AWAKE = "awake" ]; then
echo $AWAKE_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
log -p i -t screenstate_scaling "*** awake ***: switching CPU frequency governor to -> $AWAKE_GOVERNOR"
AWAKE=
fi
SLEEPING=`cat /sys/power/wait_for_fb_sleep`
if [ $SLEEPING = "sleeping" ]; then
#i want it to pause here (sleep 30?)the reason there is 30 sec pause is bcos i want it to ignore the commands below just in case #"$AWAKE=awake" without proceeding to the commands below.(or better just ignore and return to waiting_for_fb_sleep)
echo $SLEEP_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
log -p i -t screenstate_scaling "*** sleeping ***: switching CPU frequency governor to -> $SLEEP_GOVERNOR"
SLEEPING=
fi
done &)
==========================================================
So basically, after $SLEEPING="sleeping", i want it to pause for a moment(lets say "sleep 30") because that will give it some time just in case $AWAKE="awake" occur during this period.
thanks in advance..your assistance is highly appreciated
---------- Post updated at 09:09 AM ---------- Previous update was at 09:06 AM ----------
I'm thinking of maybe a "else if" ?