Commit 5965257b by Christian Brauner Committed by GitHub

Merge pull request #1767 from xnox/upstart-ssh

templates/ubuntu: conditionally move upstart ssh job, as it is now op…
parents b7ab9e86 4a1bd8d6
...@@ -152,13 +152,20 @@ exit 101 ...@@ -152,13 +152,20 @@ exit 101
EOF EOF
chmod +x $rootfs/usr/sbin/policy-rc.d 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* 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 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 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 rm -f $rootfs/usr/sbin/policy-rc.d
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment