#!/bin/sh

set -x

. /usr/share/volatile/chroot-common.sh
. /usr/share/debconf/confmodule

REBOOT=false    # poweroff by default

# if system is preloaded with factroy mode (has factory.flg)
# set to Reboot mode
if [ -f /cdrom/factory.flg ]; then
    REBOOT=true
fi

db_set ubiquity/reboot $($REBOOT && echo true || echo false)
db_set ubiquity/poweroff $($REBOOT && echo false || echo true)

exit 0
