From 4338b66e3df5add2adfeea5a72770965b8a808dd Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Fri, 2 Oct 2009 14:44:38 +0000 Subject: Added support for skipping checks when running on battery power. --- cron-sh/security.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cron-sh') diff --git a/cron-sh/security.sh b/cron-sh/security.sh index df3e9f5..32dac9c 100755 --- a/cron-sh/security.sh +++ b/cron-sh/security.sh @@ -16,6 +16,16 @@ if [[ ${CHECK_SECURITY} != yes ]]; then exit 0 fi +# are we running on battery power? +if [[ ${CHECK_ON_BATTERY} == no ]]; then + grep 'charging state' /proc/acpi/battery/*/state 2>/dev/null | grep -q 'discharging' + ret=$? + if [[ $ret = 0 ]]; then + # skipping check as we are running on battery power + exit 0 + fi +fi + . /usr/share/msec/functions.sh # variables -- cgit v1.2.1