1
0
mirror of synced 2026-01-25 11:26:31 +00:00
xen-tools.xen-tools/hooks/debian/60-copy-host-files
steve d27df26181 2006-08-18 15:08:24 by steve
1.  Copy "resolv.conf" before running apt-get update / yum update.
      Without this DNS is probably not available/working.

  2.  Copy /etc/sudoers from the host, if we're installing sudo.
2006-08-18 15:08:24 +00:00

60 lines
814 B
Bash
Executable File

#!/bin/sh
#
# Copy files from a 'skel' directory, if present, into the
# new images
#
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
#
# Copy "required" files from our host.
#
cp /etc/timezone ${prefix}/etc
#
# If the host has sudo then copy the configuration file, and install
# the package
#
if [ -e /etc/sudoers ]; then
logMessage Installing SUDO too.
#
# Copy file and fixup permissions.
#
cp /etc/sudoers ${prefix}/etc
chown root:root ${prefix}/etc/sudoers
chmod 440 ${prefix}/etc/sudoers
#
# Install sudo
#
installDebianPackage ${prefix} sudo
fi
#
# Log our finish
#
logMessage Script $0 finished