1
0
mirror of synced 2026-01-16 00:03:51 +00:00
xen-tools.xen-tools/hooks/common/75-fixup-securetty
Axel Beckert fc736c040d Refactoring: Massive code deduplication in hooks directory
All hooks files which were identical and had no second group of
identically named hook files have been moved to a new hooks/common
directory and now have symbolic links to the new single file at their
old locations.

Also slightly modified to make this work:

  * Makefile: copy new hooks/common directory
  * Some tests: ignore new hooks/common directory
2012-06-04 16:26:03 +02:00

63 lines
844 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
logMessage /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.