add command arg

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

No files matched your search

+1
View File
@@ -0,0 +1 @@
/main
+6 -1
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)
}