#!/bin/bash

for i in 5984 8080 9292; do
  VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port$i,tcp,,$i,,$i";
  VBoxManage modifyvm "boot2docker-vm" --natpf1 "udp-port$i,udp,,$i,,$i";
done

for i in {3000..3100}; do
  VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port$i,tcp,,$i,,$i";
  VBoxManage modifyvm "boot2docker-vm" --natpf1 "udp-port$i,udp,,$i,,$i";
done

for i in {49000..49003}; do
  VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port$i,tcp,,$i,,$i";
  VBoxManage modifyvm "boot2docker-vm" --natpf1 "udp-port$i,udp,,$i,,$i";
done

# vm must be powered off
#for i in 5984 8080 9292; do
# VBoxManage modifyvm "boot2docker-vm" --natpf1 delete "tcp-port$i";
# VBoxManage modifyvm "boot2docker-vm" --natpf1 delete "udp-port$i";
#done
#
#for i in {3000..3100}; do
# VBoxManage modifyvm "boot2docker-vm" --natpf1 delete "tcp-port$i";
# VBoxManage modifyvm "boot2docker-vm" --natpf1 delete "udp-port$i";
#done
#
#for i in {49000..49003}; do
# VBoxManage modifyvm "boot2docker-vm" --natpf1 delete "tcp-port$i";
# VBoxManage modifyvm "boot2docker-vm" --natpf1 delete "udp-port$i";
#done
