mirror of
https://github.com/whyvl/wireproxy.git
synced 2025-04-29 19:01:42 +02:00
Add silent flag to reduce output (#67)
This commit is contained in:
parent
6fcd53d2a0
commit
30d2697f03
4 changed files with 15 additions and 5 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
"github.com/akamensky/argparse"
|
||||
"github.com/octeep/wireproxy"
|
||||
"golang.zx2c4.com/wireguard/device"
|
||||
"suah.dev/protect"
|
||||
)
|
||||
|
||||
|
@ -63,6 +64,7 @@ func main() {
|
|||
parser := argparse.NewParser("wireproxy", "Userspace wireguard client for proxying")
|
||||
|
||||
config := parser.String("c", "config", &argparse.Options{Help: "Path of configuration file"})
|
||||
silent := parser.Flag("s", "silent", &argparse.Options{Help: "Silent mode"})
|
||||
daemon := parser.Flag("d", "daemon", &argparse.Options{Help: "Make wireproxy run in background"})
|
||||
printVerison := parser.Flag("v", "version", &argparse.Options{Help: "Print version"})
|
||||
configTest := parser.Flag("n", "configtest", &argparse.Options{Help: "Configtest mode. Only check the configuration file for validity."})
|
||||
|
@ -114,10 +116,15 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
logLevel := device.LogLevelVerbose
|
||||
if *silent {
|
||||
logLevel = device.LogLevelSilent
|
||||
}
|
||||
|
||||
// no file access is allowed from now on, only networking
|
||||
pledgeOrPanic("stdio inet dns")
|
||||
|
||||
tnet, err := wireproxy.StartWireguard(conf.Device)
|
||||
tnet, err := wireproxy.StartWireguard(conf.Device, logLevel)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue