#!/bin/bash

. /usr/lib/pm-utils/functions

resume() {
    # toggle wi-fi power only if the EC driver
    # reports that the power is on.

    value=`cat /sys/devices/platform/hpmini/wifi`
    if [ $value ]; then
        echo 0 > /sys/devices/platform/hpmini/wifi
        sleep 1
        echo 1 > /sys/devices/platform/hpmini/wifi
    fi
}

case "$1" in
	hibernate|suspend)
		;;
	thaw|resume)
		resume
		;;
	*)
		;;
esac

exit $?
