-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
65 lines (60 loc) · 1.22 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package main
import (
"bufio"
"fmt"
"os"
_ "os/exec"
)
func main() {
fmt.Println("Welcome!!")
help()
stdin := bufio.NewScanner(os.Stdin)
go cronfunction()
go webserver()
for stdin.Scan() {
config()
fmt.Println("This command is invalid")
help()
text := stdin.Text()
if text == "start" {
startapp(2, 254)
initdb()
}
if text == "stop" {
stopapp()
break
}
if text == "record" {
recordclient("192.168.224.30")
}
if text == "delete" {
fmt.Println(Rejectclient("192.168.224.30"))
}
if text == "test" {
testinput()
}
if text == "array" {
var i int
for i = 0; i < clientdatalength(); i++ {
fmt.Println(readclient(i))
}
}
if text == "nftables" {
ReadRule()
}
if text == "usersetting" {
usersetting()
}
if text == "help" {
help()
}
}
fmt.Println("Thank you !!")
}
func help() {
fmt.Println("--------Command--------")
fmt.Println("---Main1--- start: init nftables |stop: server stop & delete nftables")
fmt.Println("---Main2--- usersetting: user setting mode")
fmt.Println("---Test--- record: test |record 192.168.224.30 |delete: test delete 192.168.224.30 |test: test&debug mode")
fmt.Println("---Disp--- array: disp array |nftables: disp nftables")
}