Commit 98b5c6f8 authored by Lucas Moura's avatar Lucas Moura

Add battery verification on cronjob

parent 3060221e
Pipeline #3883936 failed with stage
in 50 seconds
......@@ -2,6 +2,19 @@
set -e
# Check if we're on battery
# This is exactly how apt-xapian-index handle the battery power
if which on_ac_power >/dev/null 2>&1; then
on_ac_power >/dev/null 2>&1
# Here we use "-eq 1" instead of "-ne 0" because
# on_ac_power could also return 255, which means
# it can't tell whether we are on AC or not. In
# that case, run update-a-x-i nevertheless.
[ "$ON_BATTERY" -eq 1 ] && exit 0
runuser -s /bin/sh -c "/usr/bin/apprec --init" apprec
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment