1
0
mirror of synced 2026-04-26 12:26:54 +00:00
Files
xen-tools.xen-tools/etc/hook.d/70-install-ssh
steve 2862fb995d 2006-05-24 19:35:16 by steve
More updates.
2006-05-24 19:35:16 +00:00

62 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
#
# This script installs OpenSSH upon the new system. It must make sure
# that the server is not running before it exits - otherwise the temporary
# mounted directory will not be unmountable.
#
# Steve
# --
# http://www.steve.org.uk/
prefix=$1
dist=$2
#
# Sets up the installation of OpenSSH on a Debian GNU/Linux system.
#
function setupDebian
{
DEBIAN_FRONTEND=noninteractive chroot ${prefix} /usr/bin/apt-get --yes --force-yes install ssh
#
# Make sure sshd isn't running, this will cause our unmounting of the
# disk image to fail..
#
chroot ${prefix} /etc/init.d/ssh stop
}
#
# Sets up the installation of OpenSSH on a CentOS4 installation.
#
function setupCentOS4
{
chroot ${prefix}/usr/bin/yum -y install openssh-server
chroot ${prefix}/usr/bin/yum -y install openssh-server
}
#
# Entry point to the script.
#
case "${dist}" in
sarge|etch|sid)
setupDebianSources
;;
centos4)
setupCentOS4
;;
*)
echo "Unknown distribution '${dist}'. Fixme";
exit;
;;
esac