#! /bin/sh

get_mem() {
	local ram=$(grep ^MemTotal: /proc/meminfo | { read x y z; echo $y; }) || true # in kilobytes
	if [ -z "$ram" ]; then
		echo "Cannot determine system memory" >&2
		ram=0
	else
		ram=$(expr "$ram" / 1024) # convert to megabytes
	fi
	echo $ram
}

if [ -z "$DEBCONF_DROP_TRANSLATIONS" ] &&
   [ $(get_mem) -lt 250 ]; then
	export DEBCONF_DROP_TRANSLATIONS=1
fi

exec debconf -o d-i $MENU
