add command arg

This commit is contained in:
octeep 2022-03-11 12:28:53 +00:00 committed by octeep
parent 41473a555a
commit b08368ad10
2 changed files with 7 additions and 1 deletions

View file

@ -343,7 +343,12 @@ func startWireguard(setting *DeviceSetting) (*netstack.Net, error) {
}
func main() {
conf, err := readConfig("/home/octeep/.config/wireproxy")
if len(os.Args) != 2 {
fmt.Println("Usage: wireproxy [config file path]")
return
}
conf, err := readConfig(os.Args[1])
if err != nil {
log.Panic(err)
}