#!/bin/sh

# pm-utils hook to handle suspend/resume properly for wicd

. "${PM_FUNCTIONS}" || . "${FUNCTIONS}"

wicd_suspend()
{
	# Put wifi interface down
	/usr/lib/wicd/suspend.py
}

wicd_resume()
{
	# Bring wifi interface back up
	/usr/lib/wicd/autoconnect.py
}

case "$1" in
	hibernate|suspend)
		wicd_suspend
		;;
	thaw|resume)
		wicd_resume
		;;
	*) exit $NA
		;;
esac

