get-kurs
This commit is contained in:
@ -1,10 +1,13 @@
|
||||
import getpass
|
||||
|
||||
def get_mysql ():
|
||||
|
||||
def get_mysql():
|
||||
u = getpass.getuser()
|
||||
f = open("/home/"+u+"/.my.cnf", "r")
|
||||
i = f.read()
|
||||
u = i.find("user=")
|
||||
p = i.find("password=")
|
||||
ro = i.find ("[clientreadonly]")
|
||||
u = i[u+5:p-1]
|
||||
ro = i.find("[clientreadonly]")
|
||||
p = i[p+9:ro-2]
|
||||
return p
|
||||
return u, p
|
||||
|
||||
Reference in New Issue
Block a user