#!/bin/sh
#
#  This script does two things:
#
#  1. Sets the console type for the first terminal to 'console'.
#  2. Comments out all virtual terminals which aren't on the first console.
#
# Steve
# --
# http://www.steve.org.uk/


prefix=$1


#
#  Source our common functions
#
if [ -e /usr/lib/xen-tools/common.sh ]; then
    . /usr/lib/xen-tools/common.sh
else
    . ./hooks/common.sh
fi


#
# Log our start
#
logMessage Script $0 starting


#
# Do the transformation.
#
sed -i -e 's/tty[0-9]$/console/g' -e 's/^\([2-6].*:respawn*\)/#\1/' -e 's/^T/#\t/' ${prefix}/etc/inittab


#
#  Log our finish
#
logMessage Script $0 finished
