From: Dimitri John Ledkov Date: Tue, 29 Aug 2017 14:11:55 +0000 (+0100) Subject: templates/ubuntu: conditionally move upstart ssh job, as it is now optional. X-Git-Tag: lxc-1.0.11~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c69a60fe3f708f2d2b7ee82d045a21a189c7020;p=thirdparty%2Flxc.git templates/ubuntu: conditionally move upstart ssh job, as it is now optional. Mimic the code from the debian template. Signed-off-by: Dimitri John Ledkov --- diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in index a397a1dc4..dba210669 100644 --- a/templates/lxc-ubuntu.in +++ b/templates/lxc-ubuntu.in @@ -115,13 +115,20 @@ exit 101 EOF chmod +x $rootfs/usr/sbin/policy-rc.d + if [ -f "$rootfs/etc/init/ssh.conf" ]; then + mv "$rootfs/etc/init/ssh.conf" "$rootfs/etc/init/ssh.conf.disabled" + fi + rm -f $rootfs/etc/ssh/ssh_host_*key* - mv $rootfs/etc/init/ssh.conf $rootfs/etc/init/ssh.conf.disabled + DPKG_MAINTSCRIPT_PACKAGE=openssh DPKG_MAINTSCRIPT_NAME=postinst chroot $rootfs /var/lib/dpkg/info/openssh-server.postinst configure - mv $rootfs/etc/init/ssh.conf.disabled $rootfs/etc/init/ssh.conf sed -i "s/root@$(hostname)/root@$hostname/g" $rootfs/etc/ssh/ssh_host_*.pub + if [ -f "$rootfs/etc/init/ssh.conf.disabled" ]; then + mv "$rootfs/etc/init/ssh.conf.disabled" "$rootfs/etc/init/ssh.conf" + fi + rm -f $rootfs/usr/sbin/policy-rc.d fi