summaryrefslogtreecommitdiff
path: root/pkg/helper
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/helper')
-rw-r--r--pkg/helper/darwin.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/helper/darwin.go b/pkg/helper/darwin.go
index 7f68243..3f8dc2f 100644
--- a/pkg/helper/darwin.go
+++ b/pkg/helper/darwin.go
@@ -87,8 +87,11 @@ func daemonize() {
log.Print("bitmask-helper daemon started")
}
-func doHandleCommands(port int) {
- runCommandServer("localhost:" + strconv.Itoa(port))
+func doHandleCommands(preferredPort int) {
+ port := getFirstAvailablePortFrom(preferredPort)
+ writePortToFile(port)
+ bindAddr := "localhost:" + strconv.Itoa(port)
+ runCommandServer(bindAddr)
}
func getOpenvpnPath() string {