Skip to content

Instantly share code, notes, and snippets.

@jmather
Created January 9, 2013 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmather/4497193 to your computer and use it in GitHub Desktop.
Save jmather/4497193 to your computer and use it in GitHub Desktop.
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