Skip to content

Commit

Permalink
🐛 reconfigure the ip address when start up
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeromy Fu committed Oct 6, 2016
1 parent 9f52560 commit 4ae0aa6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,20 @@ bbb-conf --enablewebrtc
apt-get -y -q autoremove
apt-get -y clean
SCRIPT

$startup_script = <<SCRIPT
export DEBIAN_FRONTEND=noninteractive
bbb-conf --clean
bbb-conf --check
bbb-conf --setip $(ifconfig eth1 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
echo "Finish setup on http://$(ifconfig eth1 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')"
SCRIPT


# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
Expand Down Expand Up @@ -126,4 +132,11 @@ Vagrant.configure("2") do |config|
# SHELL

config.vm.provision :shell, inline: $script

config.vm.provision "fix-no-tty", type: "shell" do |s|
s.privileged = false
s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
end

config.vm.provision :shell, inline: $startup_script, run: "always"
end

0 comments on commit 4ae0aa6

Please sign in to comment.