|
|
|
@ -6544,15 +6544,30 @@ class servFtp(shareLdap):
|
|
|
|
|
# Устанавливаем автозапуск демона
|
|
|
|
|
if not self.setDaemonAutostart("proftpd"):
|
|
|
|
|
return False
|
|
|
|
|
# Устанавливаем переменную для клиента
|
|
|
|
|
fullHostName = "%s.%s"%(self.clVars.Get('os_net_hostname'),
|
|
|
|
|
self.clVars.Get('os_net_domain'))
|
|
|
|
|
self.clVars.Set("cl_remote_ftp",fullHostName,True)
|
|
|
|
|
#cоздаем рабочую ftp директорию
|
|
|
|
|
ftpPath = self.clVars.Get("sr_ftp_path")
|
|
|
|
|
if not os.path.exists(ftpPath):
|
|
|
|
|
os.makedirs(ftpPath)
|
|
|
|
|
# Создадим иконку для share
|
|
|
|
|
fileTxt = "[Desktop Entry]\nIcon=folder-downloads"
|
|
|
|
|
fileDirectory = os.path.join(ftpPath,".directory")
|
|
|
|
|
uid = 0
|
|
|
|
|
gid = 0
|
|
|
|
|
if not self.createUserFile(fileDirectory, fileTxt, uid, gid):
|
|
|
|
|
return False
|
|
|
|
|
#cоздаем директорию tmp
|
|
|
|
|
ftpTmpPath = os.path.join(ftpPath,"tmp")
|
|
|
|
|
if not os.path.exists(ftpTmpPath):
|
|
|
|
|
os.makedirs(ftpTmpPath)
|
|
|
|
|
os.chmod(ftpTmpPath,0777)
|
|
|
|
|
#запишем переменные для клиента
|
|
|
|
|
clientVars = ["cl_remote_ftp"]
|
|
|
|
|
if not self.saveVarsClient(clientVars):
|
|
|
|
|
return False
|
|
|
|
|
self.clVars.Write("sr_ftp_set","on")
|
|
|
|
|
self.printOK(_("FTP service configured") + " ...")
|
|
|
|
|
return True
|
|
|
|
|