$ vagrant provision==> default: Running provisioner: shell...
default: Running: inline script
==> default: stdin: is not a tty
==> default: var HOST_IP=10.2.2.70
==> default: Running provisioner: shell...
default: Running: /var/folders/5m/48h7dsrx39x2vl_xqmlddtch0000gn/T/vagrant-shell20160407-5063-rurl2r.sh
==> default: stdin: is not a tty
==> default: HOST_IP=10.2.2.70
==> default: $1=arg1
-----------------------------------------
$ vagrant ssh
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-85-generic x86_64)
System information as of Thu Apr 7 20:45:34 UTC 2016
System load: 0.0 Users logged in: 0
Usage of /: 5.8% of 39.34GB IP address for eth0: 10.0.2.15
Memory usage: 33% IP address for eth1: 10.2.2.70
Swap usage: 0% IP address for docker0: 172.17.0.1
Processes: 84
Graph this data and manage this system at:
Get cloud support with Ubuntu Advantage Cloud Guest:
120 packages can be updated.
57 updates are security updates.
Last login: Thu Apr 7 20:47:07 2016 from 10.0.2.2
vagrant@vagrant-ubuntu-trusty-64:~$ echo $HOST_IP
vagrant@vagrant-ubuntu-trusty-64:~$ sudo su
root@vagrant-ubuntu-trusty-64:/home/vagrant#
--------------------------------------
$ cat provision.sh
#!/bin/bash
if [ ${HOST_IP} ]; then
echo "HOST_IP=${HOST_IP}"
export HOST_IP=${HOST_IP}
else
echo "var HOST_IP not set"
fi
if [ ${1} ]; then
echo "\$1=${1}"
fi