1
0
mirror of synced 2026-01-19 01:07:28 +00:00
xen-tools.xen-tools/hooks/dapper/75-fixup-securetty
steve 3689335cbe 2007-10-04 17:46:19 by steve
Add a script to ensure xvc0 + hvc0 are included in /etc/securetty.
  (Closes: #442926)
2007-10-04 17:46:22 +00:00

63 lines
843 B
Bash
Executable File

#!/bin/sh
#
# This script ensures /etc/securetty upon the new guests has the new
# Xen console devices in it
#
# 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
#
# If the file doesn't exist exit early.
#
if [ ! -e ${prefix}/etc/securetty ]; then
logMesage /etc/securetty not found.
exit
fi
#
# Do both the devices.
#
for i in xvc0 hvc0 ; do
#
# Only append if not presnt.
#
if ( grep $i ${prefix}/etc/securetty > /dev/null ) ; then
logMessage Host already has $i entry
else
echo $i >> ${prefix}/etc/securetty
fi
done
#
# Log our finish
#
logMessage Script $0 finished.