Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Latest vagrant provision script
#!/bin/sh
NFSUID=`stat -c %u /vagrant/`
/usr/bin/sudo su -c "cat /etc/passwd | grep -v vagrant:x: > /etc/passwd.new"
/usr/bin/sudo su -c "echo \"vagrant:x:${NFSUID}:502::/home/vagrant:/bin/bash\" >> /etc/passwd.new"
/usr/bin/sudo su -c "chown -R ${NFSUID}:vagrant /home/vagrant"
/usr/bin/sudo su -c "mv -f /etc/passwd.new /etc/passwd"
/usr/bin/sudo su -c "chown -R vagrant:vagrant /var/lib/php/session"
/usr/bin/sudo su -c "chown vagrant:vagrant /tmp/vagrant-*"
mkdir -p /vagrant/http-logs
if [ -d /vagrant/web ] && [ ! -f /vagrant/.vagrant.force.global ]
then
/usr/bin/sudo cp -f /home/vagrant/files/app.conf /etc/httpd/conf.d/vagrant.conf
else
/usr/bin/sudo cp -f /home/vagrant/files/global.conf /etc/httpd/conf.d/vagrant.conf
fi
/usr/bin/sudo su -c "/etc/init.d/httpd restart"
sleep 5
/usr/bin/sudo su -c "/etc/init.d/httpd restart"
if [ -f /vagrant/bin/.vagrant.init.sh ]
then
cd /vagrant
bash ./bin/.vagrant.init.sh
fi
echo "Finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment