From fcaf98d669f3575265ca14656706c38631f37eac Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Sat, 30 Mar 2013 16:44:31 -0300 Subject: [PATCH] Avoid vagrant user creation on quantal64 base box in case it has already been created --- boxes/quantal64/lxc-template | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/boxes/quantal64/lxc-template b/boxes/quantal64/lxc-template index 0fdef44..24c25e1 100755 --- a/boxes/quantal64/lxc-template +++ b/boxes/quantal64/lxc-template @@ -78,8 +78,10 @@ EOF rm -f $rootfs/etc/init/tty{5,6}.conf fi - chroot $rootfs useradd --create-home -s /bin/bash vagrant - echo "vagrant:vagrant" | chroot $rootfs chpasswd + if ! (grep -q vagrant $rootfs/etc/passwd); then + chroot $rootfs useradd --create-home -s /bin/bash vagrant + echo "vagrant:vagrant" | chroot $rootfs chpasswd + fi return 0 }