add command arg

This commit is contained in:
octeep 2022-03-11 12:28:53 +00:00
parent dfaa30f235
commit c652fa1052
2 changed files with 7 additions and 1 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/main

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)
}