mirror of
https://github.com/zu1k/nali.git
synced 2025-01-23 21:59:02 +08:00
40 lines
624 B
Go
40 lines
624 B
Go
// +build !windows
|
|
|
|
package app
|
|
|
|
import (
|
|
"bufio"
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func Root(args []string) {
|
|
if len(args) == 0 {
|
|
stdin := bufio.NewScanner(os.Stdin)
|
|
for stdin.Scan() {
|
|
line := stdin.Text()
|
|
if line == "quit" || line == "exit" {
|
|
return
|
|
}
|
|
fmt.Printf("%s\n", ReplaceIPInString(ReplaceCDNInString(line)))
|
|
}
|
|
} else {
|
|
ParseIPs(args)
|
|
}
|
|
}
|
|
|
|
func CDN(args []string) {
|
|
if len(args) == 0 {
|
|
stdin := bufio.NewScanner(os.Stdin)
|
|
for stdin.Scan() {
|
|
line := stdin.Text()
|
|
if line == "quit" || line == "exit" {
|
|
return
|
|
}
|
|
fmt.Println(ReplaceCDNInString(line))
|
|
}
|
|
} else {
|
|
ParseCDNs(args)
|
|
}
|
|
}
|