Created
January 9, 2013 21:38
-
-
Save jmather/4497193 to your computer and use it in GitHub Desktop.
Latest vagrant provision script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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