dospin/net_freebsd.go

29 lines
680 B
Go
Raw Normal View History

2016-02-26 17:35:57 -06:00
/*
Copyright 2016 gtalent2@gmail.com
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
2016-02-14 23:38:28 -06:00
package main
func setupPortForward(ip, port string) {
}
2016-02-27 18:15:37 -06:00
func portUsageCount(ports ...[]int) int {
const CMD = "sockstat -4c -p 22"
return 0
}
func portUsageCount(ports ...int) int {
cmd := "sockstat -4c"
for _, v := range ports {
cmd += " -p " + strconv.Itoa(v)
}
out, err := exec.Command(cmd).Output()
if err != nil {
log.Println("Port Usage Check: Could not run ", cmd)
}
return bytes.Count(out, []byte{'\n'}) - 1
}