#!/bin/sh
# Stop distributed-net on low battery.  If the status can't be
# determined do nothing.

test -x /usr/bin/distributed-net || exit 0

if [ "$1,$2" = "change,power" ]; then
	if on_ac_power >/dev/null; then
		if [ -e /etc/rc2.d/S20distributed-net ]; then
			/etc/init.d/distributed-net start
		fi
	elif [ $? -eq 1 ]; then
		/etc/init.d/distributed-net stop
	fi
fi
