Skip to content

Commit

Permalink
bug fix: ftp
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Apr 17, 2020
1 parent 975f8c3 commit 8fd2e73
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion install/install.py
Expand Up @@ -190,7 +190,7 @@ def mountTemp(self):
@staticmethod
def pureFTPDServiceName(distro):
if distro == ubuntu:
return 'pure-ftpd'
return 'pure-ftpd-mysql'
return 'pure-ftpd'

@staticmethod
Expand Down
20 changes: 9 additions & 11 deletions install/installCyberPanel.py
Expand Up @@ -348,11 +348,11 @@ def fixMariaDB(self):

def installPureFTPD(self):
if self.distro == ubuntu:
command = 'apt-get -y install ' + install.preFlightsChecks.pureFTPDServiceName(self.distro)
command = 'DEBIAN_FRONTEND=noninteractive apt install pure-ftpd-mysql -y'
os.system(command)
else:
command = "yum install -y pure-ftpd"

install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)

####### Install pureftpd to system startup

Expand Down Expand Up @@ -428,8 +428,6 @@ def installPureFTPDConfigurations(self, mysql):
writeDataToFile.close()

if self.distro == ubuntu:
command = 'apt install pure-ftpd-mysql libmariadb3 -y'
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)

if os.path.exists('/etc/pure-ftpd/db/mysql.conf'):
os.remove('/etc/pure-ftpd/db/mysql.conf')
Expand All @@ -446,16 +444,16 @@ def installPureFTPDConfigurations(self, mysql):
command = 'echo "40110 40210" > /etc/pure-ftpd/conf/PassivePortRange'
subprocess.call(command, shell=True)

command = 'wget https://ubuntu.cyberpanel.net/pool/main/p/pure-ftpd/pure-ftpd-common_1.0.47-3_all.deb'
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
command = 'echo "no" > /etc/pure-ftpd/conf/UnixAuthentication'
subprocess.call(command, shell=True)

command = 'wget https://ubuntu.cyberpanel.net/pool/main/p/pure-ftpd/pure-ftpd-mysql_1.0.47-3_amd64.deb'
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
command = 'echo "/etc/pure-ftpd/db/mysql.conf" > /etc/pure-ftpd/conf/MySQLConfigFile'
subprocess.call(command, shell=True)

command = 'dpkg --install --force-confold pure-ftpd-common_1.0.47-3_all.deb'
command = 'ln -s /etc/pure-ftpd/conf/MySQLConfigFile /etc/pure-ftpd/auth/30mysql'
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)

command = 'dpkg --install --force-confold pure-ftpd-mysql_1.0.47-3_amd64.deb'
command = 'ln -s /etc/pure-ftpd/conf/UnixAuthentication /etc/pure-ftpd/auth/65unix'
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)

command = 'systemctl restart pure-ftpd-mysql.service'
Expand Down

0 comments on commit 8fd2e73

Please sign in to comment.