#!/bin/bash

# Checks the battery. If it is not 100%, suspend sieve.

sievepid=`/sbin/pidof sieve`

if [ -z $sievepid ] ; then
  if [ -f /home/phma/nfsieve/nfs.out ] ; then
    /home/phma/nfsieve/sieben
  fi
else
  if [ `/usr/bin/battery` = "100%" ] ; then
    kill -CONT $sievepid
    renice 20 $sievepid >/dev/null
  else
    kill -STOP $sievepid
  fi
fi

