Pndpd/main.go

34 lines
683 B
Go
Raw Normal View History

2021-12-20 14:53:42 -05:00
package main
import (
"fmt"
"os"
)
func main() {
2021-12-21 06:43:44 -05:00
fmt.Println("PNDPD Version 0.3 by Kioubit")
2021-12-21 06:42:30 -05:00
fmt.Println("Usage: pndpd readconfig <path to file>")
fmt.Println("Usage: pndpd respond <interface> <optional whitelist of CIDRs separated with a semicolon>")
2021-12-20 16:46:26 -05:00
fmt.Println("Usage: pndpd proxy <interface1> <interface2>")
2021-12-20 14:53:42 -05:00
if len(os.Args) <= 1 {
2021-12-20 16:46:26 -05:00
fmt.Println("Specify command")
2021-12-20 14:53:42 -05:00
os.Exit(1)
}
2021-12-20 16:46:26 -05:00
if os.Args[1] == "respond" {
2021-12-21 06:42:30 -05:00
if len(os.Args) == 4 {
simpleRespond(os.Args[2], parseFilter(os.Args[3]))
} else {
simpleRespond(os.Args[2], nil)
}
2021-12-20 16:46:26 -05:00
}
if os.Args[1] == "proxy" {
proxy(os.Args[2], os.Args[3])
}
2021-12-21 06:42:30 -05:00
if os.Args[1] == "readConfig" {
readConfig(os.Args[2])
2021-12-21 06:00:28 -05:00
}
2021-12-20 16:46:26 -05:00
2021-12-20 14:53:42 -05:00
}