Skip to content

Commit

Permalink
[NetworkSetup] fix ftp server autostart detection
Browse files Browse the repository at this point in the history
Info: was 'S80vsftpd' and can't removed, but after update-rc.d has set to 'S20vsftpd'
  • Loading branch information
iPkay authored and koivo committed Jul 15, 2018
1 parent fabb7f3 commit 9be113d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/python/Screens/NetworkSetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from subprocess import call
import commands
import os
import glob

if float(getVersionString()) >= 4.0:
basegroup = "packagegroup-base"
Expand Down Expand Up @@ -2028,21 +2029,23 @@ def StartStopCallback(self, result = None, retval = None, extra_args = None):

def activateFtp(self):
commands = []
if fileExists('/etc/rc2.d/S20vsftpd'):
if len(glob.glob('/etc/rc2.d/S*0vsftpd')):
#if fileExists('/etc/rc2.d/S20vsftpd'):
commands.append('update-rc.d -f vsftpd remove')
else:
commands.append('update-rc.d -f vsftpd defaults')
self.Console.eBatch(commands, self.StartStopCallback, debug=True)

def updateService(self):
import process
p = process.ProcessList()
import process
p = process.ProcessList()
ftp_process = str(p.named('vsftpd')).strip('[]')
self['labrun'].hide()
self['labstop'].hide()
self['labactive'].setText(_("Disabled"))
self.my_ftp_active = False
if fileExists('/etc/rc2.d/S20vsftpd'):
if len(glob.glob('/etc/rc2.d/S*0vsftpd')):
#if fileExists('/etc/rc2.d/S20vsftpd'):
self['labactive'].setText(_("Enabled"))
self['labactive'].show()
self.my_ftp_active = True
Expand Down

0 comments on commit 9be113d

Please sign in to comment.