aboutsummaryrefslogtreecommitdiffstats
path: root/cron-sh/security.sh
diff options
context:
space:
mode:
Diffstat (limited to 'cron-sh/security.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