aboutsummaryrefslogtreecommitdiffstats
path: root/cron-sh
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2009-10-02 14:44:38 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2009-10-02 14:44:38 +0000
commit4338b66e3df5add2adfeea5a72770965b8a808dd (patch)
treebeb0bb9050397c8e60bba303183e9e9ca09dbf05 /cron-sh
parentddd900a61dff3f902fa6b84bcf7f3e8d1a081575 (diff)
downloadmsec-4338b66e3df5add2adfeea5a72770965b8a808dd.tar
msec-4338b66e3df5add2adfeea5a72770965b8a808dd.tar.gz
msec-4338b66e3df5add2adfeea5a72770965b8a808dd.tar.bz2
msec-4338b66e3df5add2adfeea5a72770965b8a808dd.tar.xz
msec-4338b66e3df5add2adfeea5a72770965b8a808dd.zip
Added support for skipping checks when running on battery power.
Diffstat (limited to 'cron-sh')
-rwxr-xr-xcron-sh/security.sh10
1 files changed, 10 insertions, 0 deletions
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