#!/bin/sh
#
# 99laptop-mode: Re-apply laptop mode tools settings

if [ -f /etc/pm/sleep.d/99laptop-mode ]; then
    continue
else
    case "$1" in
	    hibernate|suspend)
		    # Stopping is not required.
		    ;;
	    thaw|resume)
		    # Make laptop mode tools forcibly re-apply the hardware settings
		    # that laptop mode tools applies.			
		    if [ -e /usr/sbin/laptop_mode ] ; then
			[ -f /etc/default/laptop-mode ] && . /etc/default/laptop-mode
			if [ x$ENABLE_LAPTOP_MODE != xfalse ]; then
			    /usr/sbin/laptop_mode auto force
			fi
		    fi
		    ;;
	    *) exit $NA
		    ;;
    esac
fi
