Skip to content

Commit

Permalink
nicer method name
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Feb 8, 2018
1 parent e061799 commit 3b40b52
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/clients/ftp-server_auto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def main
# This has to be done at first. (bnc#888212)
Mode.SetMode("normal")
FtpServer.InitDaemon
FtpServer.InitStartViaSocket
FtpServer.read_daemon
end
@ret = FtpServer.Write
Mode.SetMode(old_mode)
Expand Down
6 changes: 3 additions & 3 deletions src/include/ftp-server/wid_functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def StartNowVsftpd

# Function stop vsftpd
def StopNowVsftpd
if FtpServer.InitStartViaSocket
if FtpServer.start_via_socket?
# if socket is listening, stop it
FtpServer.WriteStartViaSocket(false)
end
Expand All @@ -148,8 +148,8 @@ def SaveAndRestartVsftpd
#
# init starting via socket and update status
def InitStartStopRestart(_key = nil)
log.info "current status socket: #{FtpServer.InitStartViaSocket} service: #{Service.active?("vsftpd")}"
if FtpServer.InitStartViaSocket || Service.active?("vsftpd")
log.info "current status socket: #{FtpServer.start_via_socket?} service: #{Service.active?("vsftpd")}"
if FtpServer.start_via_socket? || Service.active?("vsftpd")
UI.ReplaceWidget(
Id("_cwm_service_status_rp"),
Label(_("FTP is running"))
Expand Down
2 changes: 1 addition & 1 deletion src/include/ftp-server/write_load.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def initialize_ftp_server_write_load(include_target)
Yast.import "SystemdSocket"
end

def InitStartViaSocket
def start_via_socket?
socket = SystemdSocket.find("vsftpd")
return false unless socket

Expand Down
2 changes: 1 addition & 1 deletion src/modules/FtpServer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def ReadSettings
end

def read_daemon
if InitStartViaSocket()
if start_via_socket?()
FtpServer.EDIT_SETTINGS["StartDaemon"] = "2"
elsif Service.active?("vsftpd")
FtpServer.EDIT_SETTINGS["StartDaemon"] = "1"
Expand Down

0 comments on commit 3b40b52

Please sign in to comment.