Fix ssh key labelling
authorPeter Palfrader <peter@palfrader.org>
Wed, 20 Jun 2012 08:08:39 +0000 (10:08 +0200)
committerPeter Palfrader <peter@palfrader.org>
Wed, 20 Jun 2012 08:08:39 +0000 (10:08 +0200)
modules/ganeti2/templates/instance-debootstrap/hooks/10-dsa-install-extra-packages.erb

index f87d165..0b0b866 100755 (executable)
@@ -10,8 +10,9 @@ fi
 chroot "$TARGET" apt-get -qq update
 chroot "$TARGET" apt-get -qq install vim ssh extlinux
 
-hostname="$(hostname)"
-sed -e "s#root@$hostname#root@$instance#" -i /etc/ssh/ssh*pub
+node="$(hostname)"
+instance="$(cat $TARGET/etc/hostname)"
+sed -e "s#root@$node#root@$instance#" -i "$TARGET"/etc/ssh/ssh*pub
 
 if [ "$ARCH" = "amd64" ]; then
     chroot "$TARGET" apt-get -qq install linux-image-amd64