|
|
@ -224,7 +224,7 @@ def getPort(): |
|
|
|
conf = getServerDir() + '/redis.conf' |
|
|
|
conf = getServerDir() + '/redis.conf' |
|
|
|
content = mw.readFile(conf) |
|
|
|
content = mw.readFile(conf) |
|
|
|
|
|
|
|
|
|
|
|
rep = r"^(" + r'port' + r')\s*([.0-9A-Za-z_& ~]+)' |
|
|
|
rep = r"^(" + r'port' + r'\)\s*([.0-9A-Za-z_& ~]+)' |
|
|
|
tmp = re.search(rep, content, re.M) |
|
|
|
tmp = re.search(rep, content, re.M) |
|
|
|
if tmp: |
|
|
|
if tmp: |
|
|
|
return tmp.groups()[1] |
|
|
|
return tmp.groups()[1] |
|
|
@ -236,7 +236,7 @@ def getRedisCmd(): |
|
|
|
requirepass = "" |
|
|
|
requirepass = "" |
|
|
|
conf = getServerDir() + '/redis.conf' |
|
|
|
conf = getServerDir() + '/redis.conf' |
|
|
|
content = mw.readFile(conf) |
|
|
|
content = mw.readFile(conf) |
|
|
|
rep = r"^(requirepass" + r')\s*([.0-9A-Za-z_& ~]+)' |
|
|
|
rep = r"^(requirepass" + r"\)\s*([.0-9A-Za-z_& ~]+)" |
|
|
|
tmp = re.search(rep, content, re.M) |
|
|
|
tmp = re.search(rep, content, re.M) |
|
|
|
if tmp: |
|
|
|
if tmp: |
|
|
|
requirepass = tmp.groups()[1] |
|
|
|
requirepass = tmp.groups()[1] |
|
|
@ -246,12 +246,10 @@ def getRedisCmd(): |
|
|
|
# findDebian = mw.execShell('cat /etc/issue |grep Debian') |
|
|
|
# findDebian = mw.execShell('cat /etc/issue |grep Debian') |
|
|
|
# if findDebian[0] != '': |
|
|
|
# if findDebian[0] != '': |
|
|
|
# default_ip = mw.getLocalIp() |
|
|
|
# default_ip = mw.getLocalIp() |
|
|
|
cmd = getServerDir() + "/bin/redis-cli -h " + \ |
|
|
|
cmd = getServerDir() + "/bin/redis-cli -h " + default_ip + ' -p ' + port + " " |
|
|
|
default_ip + ' -p ' + port + " " |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if requirepass != "": |
|
|
|
if requirepass != "": |
|
|
|
cmd = getServerDir() + '/bin/redis-cli -h ' + default_ip + \ |
|
|
|
cmd = getServerDir() + '/bin/redis-cli -h ' + default_ip + ' -p ' + port + ' -a "' + requirepass + '" ' |
|
|
|
' -p ' + port + ' -a "' + requirepass + '" ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return cmd |
|
|
|
return cmd |
|
|
|
|
|
|
|
|
|
|
|