#!/bin/sh

/lib/debian-installer/exit-command
CMDN=$?

case "$CMDN" in
20) CMD=reboot;;
21) CMD=halt;;
22) CMD=poweroff;;
*) echo "got weird return code $CMDN";;
esac

#/bin/umount -a -r
/sbin/swapoff -a

$CMD -f

# if possible, give init a chance to kill main-menu
if type sleep >/dev/null 2>&1; then
	sleep 10 || true
fi
