Update index.py

This commit is contained in:
Mr Chen
2019-01-04 16:23:39 +08:00
parent e7c228cd35
commit 58bd54ee67
+8
View File
@@ -196,6 +196,14 @@ def pftpUser():
def pftpAdd(username, password, path):
user = pftpUser()
if not os.path.exists(path):
os.mkdir(path)
if public.isAppleSystem():
os.system('chown ' + user + '.staff ' + path)
else:
os.system('chown www.www ' + path)
cmd = getServerDir() + '/bin/pure-pw useradd ' + username + ' -u ' + user + ' -d ' + \
path + '<<EOF \n' + password + '\n' + password + '\nEOF'
return public.execShell(cmd)