heron
2017-08-22 f0e9e5a1b61da75a3f60f8906c30c9832ea7ef85
debug on off 옵션 추가
2 files modified
43 ■■■■■ changed files
README.MD 8 ●●●●● patch | view | raw | blame | history
src/accessmotion.my/shell/shell.go 35 ●●●● patch | view | raw | blame | history
README.MD
....@@ -10,8 +10,6 @@
1010
1111
1212
13
-
14
-
15
-root# sudo vi /etc/shells -> /bin/ipes 추가
16
-pbsvr# chsh -s /bin/ipes
17
-ipes# chsh -s /bin/ipes
13
+ipes user 추가.
14
+root# vi /etc/shells -> /bin/ipes 추가
15
+root# chsh ipes -s /bin/ipes
src/accessmotion.my/shell/shell.go
....@@ -64,7 +64,20 @@
6464 readline.PcItem("SSL"),
6565 readline.PcItem("ALL"),
6666 ),
67
- readline.PcItem("off"),
67
+ readline.PcItem("off",
68
+ readline.PcItem("SYS"),
69
+ readline.PcItem("LOG"),
70
+ readline.PcItem("ERR"),
71
+ readline.PcItem("DOMAINS"),
72
+ readline.PcItem("SESSION"),
73
+ readline.PcItem("URIPATH"),
74
+ readline.PcItem("AAA"),
75
+ readline.PcItem("HTMLOUT"),
76
+ readline.PcItem("AGNTCHK"),
77
+ readline.PcItem("TELCO"),
78
+ readline.PcItem("SSL"),
79
+ readline.PcItem("ALL"),
80
+ ),
6881 ),
6982 readline.PcItem("url"),
7083 ),
....@@ -79,7 +92,6 @@
7992 }
8093 return r, true
8194 }
82
-
8395
8496 func Shell() {
8597 l, err := readline.NewEx(&readline.Config{
....@@ -275,7 +287,6 @@
275287 //fmt.Printf("%s\n",strings.TrimSpace(string(outputs[i])))
276288 desc, prs := configDesc[i]
277289 if prs == false{
278
-
279290 }else {
280291 var output []string = strings.Split(string(outputs[i]),",")
281292 fmt.Printf("value: %s -- %s \n",
....@@ -401,17 +412,27 @@
401412 }else {
402413 value := getConfig("debug_state")
403414 valueToint,_ := strconv.Atoi(value)
404
- valueToint = valueToint + desc
415
+ valueToint = valueToint | desc
405416 setConfig("debug_state","0",strconv.Itoa(valueToint))
406417 }
407418 break
408419 case strings.HasPrefix(line, "off"):
409
- desc, prs := debugNames["DEBUG_OFF"]
420
+ line := strings.TrimSpace(line[3:])
421
+ if len(line) == 0 {
422
+ usage(l.Stderr())
423
+ break
424
+ }
425
+ desc, prs := debugNames["DEBUG_"+line]
410426 if prs == false{
411427 }else {
412
- setConfig("debug_state","0",strconv.Itoa(desc))
428
+ value := getConfig("debug_state")
429
+ valueToint,_ := strconv.Atoi(value)
430
+ valueToint = valueToint | desc
431
+ valueToint = valueToint ^ desc
432
+ setConfig("debug_state","0",strconv.Itoa(valueToint))
413433 }
414434 break
435
+
415436 case strings.HasPrefix(line, "session"):
416437 desc, prs := debugNames["DEBUG_SESSION"]
417438 if prs == false{
....@@ -434,7 +455,6 @@
434455 setConfig("parental_control_url","1",line)
435456 }
436457
437
-
438458 var debugNames = map[string]int{
439459 "DEBUG_OFF":0,
440460 "DEBUG_SYS":1,
....@@ -450,7 +470,6 @@
450470 "DEBUG_SSL":1024,
451471 "DEBUG_ALL":2047,
452472 }
453
-
454473
455474 var configNames = map[string]int{
456475 "enable":0,