mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-26 21:21:53 +08:00
修改redis recover模块
This commit is contained in:
+14
-2
@@ -298,18 +298,30 @@ func getconfig(conn net.Conn) (dbfilename string, dir string, err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
dbfilename, err = readreply(conn)
|
text, err := readreply(conn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
text1 := strings.Split(text, "\n")
|
||||||
|
if len(text1) > 2 {
|
||||||
|
dbfilename = text1[len(text1)-2]
|
||||||
|
} else {
|
||||||
|
dbfilename = text1[0]
|
||||||
|
}
|
||||||
_, err = conn.Write([]byte(fmt.Sprintf("CONFIG GET dir\r\n")))
|
_, err = conn.Write([]byte(fmt.Sprintf("CONFIG GET dir\r\n")))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
dir, err = readreply(conn)
|
text, err = readreply(conn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
text1 = strings.Split(text, "\n")
|
||||||
|
if len(text1) > 2 {
|
||||||
|
dir = text1[len(text1)-2]
|
||||||
|
} else {
|
||||||
|
dir = text1[0]
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user