Thread: Bash Script Monitor and take action
hi
in process of writing bash script (which run on netbook) monitor status of ac power , take action if power changes battery power, namely suspend netbook. when netbook resumes script should start again, happy until ac power changes.
part troubles me how script keep running after has told netbook suspend. way have found far write second "inverse" script watches change ac power battery power, calls first script again, seems on top. how can combine 2 scripts in one?(i know on_ac_power it's not how make script "work", scripting , syntax)
script (in english)
also, should have script running time (so whilst ac power on keeps looping @ timed inteval) or "better" run cronjob?code:script 1 there ac power? yes loop. no run script 2 , suspend. exit script 2 there battery power? yes loop. (we want suspend after loss of ac power) no run script 1. exit
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Bash Script Monitor and take action
Ubuntu

Comments
Post a Comment