Commit b867d614c495b7d7834fa980dbcbe53c6fe7df06
1 parent
71178d9a
Exists in
master
and in
18 other branches
script/vagrant: extract APT proxy setup
Showing
2 changed files
with
17 additions
and
10 deletions
Show diff stats
... | ... | @@ -0,0 +1,15 @@ |
1 | +#!/bin/sh | |
2 | + | |
3 | +set -e | |
4 | + | |
5 | +sudo apt-get install -qy netcat-traditional | |
6 | + | |
7 | +# apt-cacher-ng running on the host | |
8 | +# 10.0.2.2 = host ip on virtualbox/qemu | |
9 | +# 192.168..122.1 = host ip on default libvirt bridge | |
10 | +# 172.17.42.1 = host ip on default docker bridge | |
11 | +for ip in 10.0.2.2 192.168.122.1 172.17.42.1; do | |
12 | + if nc -z -w 1 $ip 3142; then | |
13 | + echo "Acquire::http::Proxy \"http://$ip:3142\";" | sudo tee /etc/apt/apt.conf.d/01proxy | |
14 | + fi | |
15 | +done | ... | ... |
script/vagrant
1 | 1 | #!/bin/sh |
2 | 2 | |
3 | 3 | set -e |
4 | -sudo apt-get install netcat-traditional | |
5 | 4 | |
6 | -# apt-cacher-ng running on the host | |
7 | -# 10.0.2.2 = host ip on virtualbox/qemu | |
8 | -# 192.168..122.1 = host ip on default libvirt bridge | |
9 | -for ip in 10.0.2.2 192.168.122.1; do | |
10 | - if nc -z -w 1 $ip 3142; then | |
11 | - echo "Acquire::http::Proxy \"http://$ip:3142\";" | sudo tee /etc/apt/apt.conf.d/01proxy | |
12 | - fi | |
13 | -done | |
5 | +cd /vagrant | |
6 | +./script/set-apt-proxy | |
14 | 7 | |
15 | 8 | sudo DEBIAN_FRONTEND=noninteractive apt-get install -qy postfix |
16 | 9 | sudo postconf virtual_alias_maps=hash:/etc/postfix/virtual |
... | ... | @@ -20,5 +13,4 @@ EOF |
20 | 13 | sudo postmap /etc/postfix/virtual |
21 | 14 | sudo service postfix reload |
22 | 15 | |
23 | -cd /vagrant | |
24 | 16 | ./script/quick-start | ... | ... |