#!/bin/sh
#
# This script is ran before the profile was deselected.
# It can be regarded as a pre-if-down script for the current profile
#
# Ite receives the following parameters:
# $1 = the root profile directory
# $2 = the selected profile (can be used if multiple profile have
#      the same after-select script)

PROFILE_DIR="${1}"
PROFILE="${2}"

LOGGER="/usr/bin/logger -p daemon.info -t laptop-net:${PROFILE}"


case ${PROFILE} in
	nastynet|airport)
		${LOGGER} "Flushing the mail queue before disconnecting from \"${PROFILE}\""
		invoke-rc.d postfix flush
		;;
	*)
		${LOGGER} "Unknown profile \"${PROFILE}\""
		;;
esac

