diff --git a/Vagrantfile b/Vagrantfile index b3061439d..16fc2f1c0 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -134,7 +134,7 @@ def configureLinuxProvisioners(vmCfg) vmCfg.vm.provision "shell", privileged: true, - path: './scripts/vagrant-linux-priv-config.sh' + path: './scripts/linux-priv-config.sh' vmCfg.vm.provision "shell", privileged: true, diff --git a/scripts/vagrant-linux-priv-config.sh b/scripts/linux-priv-config.sh similarity index 83% rename from scripts/vagrant-linux-priv-config.sh rename to scripts/linux-priv-config.sh index 5d7126a3b..40f84607d 100755 --- a/scripts/vagrant-linux-priv-config.sh +++ b/scripts/linux-priv-config.sh @@ -49,6 +49,8 @@ hostname=$(hostname) sed -i -e "s/.*nomad.*/${ip} ${hostname}/" /etc/hosts # Ensure we cd into the working directory on login -if ! grep "cd /opt/gopath/src/github.com/hashicorp/nomad" /home/vagrant/.profile ; then - echo 'cd /opt/gopath/src/github.com/hashicorp/nomad' >> /home/vagrant/.profile +if [ -d /home/vagrant/ ] ; then + if ! grep "cd /opt/gopath/src/github.com/hashicorp/nomad" /home/vagrant/.profile ; then + echo 'cd /opt/gopath/src/github.com/hashicorp/nomad' >> /home/vagrant/.profile + fi fi diff --git a/scripts/release/Dockerfile b/scripts/release/Dockerfile index 6f3b90831..b0d527a32 100644 --- a/scripts/release/Dockerfile +++ b/scripts/release/Dockerfile @@ -18,8 +18,8 @@ RUN useradd --create-home vagrant \ && echo 'vagrant ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers # install priv packages -COPY ./scripts/vagrant-linux-priv-config.sh /tmp/scripts/vagrant-linux-priv-config.sh -RUN /tmp/scripts/vagrant-linux-priv-config.sh +COPY ./scripts/linux-priv-config.sh /tmp/scripts/linux-priv-config.sh +RUN /tmp/scripts/linux-priv-config.sh COPY ./scripts/vagrant-linux-priv-go.sh /tmp/scripts/vagrant-linux-priv-go.sh RUN /tmp/scripts/vagrant-linux-priv-go.sh