Skip to content

Commit

Permalink
Remove the NAT commands other than the core command with a warning me…
Browse files Browse the repository at this point in the history
…ssage

It's actually far easier and less error-prone to create a standard or manual
switch, then configure whichever NAT service the user wants to use manually.
  • Loading branch information
churchers committed Jun 22, 2018
1 parent 7db395f commit ec61996
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/vm-switch
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ switch::init(){
#
switch::list(){
local _switchlist _switch _type
local _id _format="%s^%s^%s^%s^%s^%s^%s^%s^%s\n"
local _id _format="%s^%s^%s^%s^%s^%s^%s^%s\n"

config::core::get "_switchlist" "switch_list"

{
printf "${_format}" "NAME" "TYPE" "IDENT" "ADDRESS" "PRIVATE" "MTU" "VLAN" "NAT" "PORTS"
printf "${_format}" "NAME" "TYPE" "IDENT" "ADDRESS" "PRIVATE" "MTU" "VLAN" "PORTS"

if [ -n "${_switchlist}" ]; then
for _switch in ${_switchlist}; do
Expand Down
2 changes: 1 addition & 1 deletion lib/vm-switch-manual
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ switch::manual::show(){

config::core::get "_bridge" "bridge_${_name}"
config::core::get "_priv" "private_${_name}" "no"
printf "${_format}" "${_name}" "manual" "${_bridge}" "n/a" "${_priv}" "n/a" "n/a" "n/a" "n/a"
printf "${_format}" "${_name}" "manual" "${_bridge}" "n/a" "${_priv}" "n/a" "n/a" "n/a"
}

# create a manual switch
Expand Down
5 changes: 2 additions & 3 deletions lib/vm-switch-standard
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,16 @@ switch::standard::init(){
switch::standard::show(){
local _name="$1"
local _format="$2"
local _id _vlan _ports _nat _addr _mtu _priv
local _id _vlan _ports _addr _mtu _priv

config::core::get "_ports" "ports_${_name}"
config::core::get "_vlan" "vlan_${_name}"
config::core::get "_nat" "nat_${_name}"
config::core::get "_addr" "addr_${_name}"
config::core::get "_mtu" "mtu_${_name}"
config::core::get "_priv" "private_${_name}" "no"

printf "${_format}" "${_name}" "standard" "-" "${_addr:--}" "${_priv}" "${_mtu:--}" \
"${_vlan:--}" "${_nat:--}" "${_ports:--}"
"${_vlan:--}" "${_ports:--}"
}

# create a standard virtual switch
Expand Down
2 changes: 1 addition & 1 deletion lib/vm-switch-vale
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ switch::vale::show(){
local _id

switch::vale::id "_id" "${_name}"
printf "${_format}" "${_name}" "vale" "${_id}" "n/a" "n/a" "n/a" "n/a" "n/a" "n/a"
printf "${_format}" "${_name}" "vale" "${_id}" "n/a" "n/a" "n/a" "n/a" "n/a"
}

# create a vale switch
Expand Down
2 changes: 1 addition & 1 deletion lib/vm-switch-vxlan
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ switch::vxlan::show(){
config::core::get "_addr" "addr_${_name}"
config::core::get "_priv" "private_${_name}" "no"

printf "${_format}" "${_name}" "vxlan" "${_id}" "${_addr}" "${_priv}" "n/a" "${_vlan}" "n/a" "${_port}"
printf "${_format}" "${_name}" "vxlan" "${_id}" "${_addr}" "${_priv}" "n/a" "${_vlan}" "${_port}"
}

# create a vxlan switch
Expand Down
2 changes: 1 addition & 1 deletion vm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# POSSIBILITY OF SUCH DAMAGE.

VERSION=1.2
VERSION_INT=102058
VERSION_INT=102059
VERSION_BSD=$(uname -K)
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin

Expand Down

0 comments on commit ec61996

Please sign in to comment.