Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions lib/vagrant_utm/scripts/add_port_forwards.applescript
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ on run argv
set ruleComponents to text items of ruleArg

-- Create a port forwarding rule record
set portForwardRule to { �
indexVal:indexNumber, protocolVal:item 1 of ruleComponents, �
guestAddress:item 2 of ruleComponents, guestPort:item 3 of ruleComponents, �
hostAddress:item 4 of ruleComponents, hostPort:item 5 of ruleComponents �
}
set portForwardRule to { indexVal:indexNumber, protocolVal:item 1 of ruleComponents, guestAddress:item 2 of ruleComponents, guestPort:item 3 of ruleComponents, hostAddress:item 4 of ruleComponents, hostPort:item 5 of ruleComponents }

-- Add the rule to the list
set end of portForwardRules to portForwardRule
Expand All @@ -49,13 +45,7 @@ on run argv
set portForwards to port forwards of anInterface

-- Create a new port forward configuration
set newPortForward to { �
protocol:(protocolVal of portForwardRule), �
guest address:(guestAddress of portForwardRule), �
guest port:(guestPort of portForwardRule), �
host address:(hostAddress of portForwardRule), �
host port:(hostPort of portForwardRule) �
}
set newPortForward to { protocol:(protocolVal of portForwardRule), guest address:(guestAddress of portForwardRule), guest port:(guestPort of portForwardRule), host address:(hostAddress of portForwardRule), host port:(hostPort of portForwardRule) }

-- Add new port forward to the list
copy newPortForward to the end of portForwards
Expand All @@ -69,4 +59,4 @@ on run argv
-- Update the VM configuration
update configuration of vm with config
end tell
end run
end run
6 changes: 2 additions & 4 deletions lib/vagrant_utm/scripts/read_forwarded_ports.applescript
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ on run argv
set i to i + 1
# Log the port forward details Virtualbox style
# 'Forwarding(nicIndex)(ruleIndex)="protocol,guestAddress,guestPort,hostAddress,hostPort"'
log "Forwarding(" & index of anInterface & ")(" & i & ")=\"" & protocol of aPortForward & "," �
& guest address of aPortForward & "," & guest port of aPortForward & "," �
& host address of aPortForward & "," & host port of aPortForward & "\""
log "Forwarding(" & index of anInterface & ")(" & i & ")=\"" & protocol of aPortForward & "," & guest address of aPortForward & "," & guest port of aPortForward & "," & host address of aPortForward & "," & host port of aPortForward & "\""
end repeat
end if
end repeat
end tell
end run
end run