Added passenger_manager commands

This commit is contained in:
Alexey Berezhok
2024-12-11 23:46:22 +03:00
parent 4905975d79
commit 4a10c586e1
4 changed files with 108 additions and 5 deletions

View File

@@ -132,11 +132,40 @@ class PassengerWorker < Kernel::ModuleCoreWorker
ACTION_OK
end
when "set_user_ruby"
domain = args[1]
ruby_ver = args[2]
if domain.nil? || ruby_ver.nil?
log_return("Domain or ruby version should be specified. #{args}")
else
if File.exist?(ruby_ver)
dom_file = get_module_conf("domains.conf")
hestia_save_file_key_pair(dom_file, domain, ruby_ver)
ACTION_OK
else
log_return("Ruby path doesn't exists. #{ruby_ver}")
end
end
when "disable_user"
domain = args[1]
if domain.nil?
log_return("Domain should be specified. #{args}")
else
#TODO
dom_file = get_module_conf("domains.conf")
hestia_save_file_key_pair(dom_file, domain, "")
ACTION_OK
end
when "get_user_ruby"
domain = args[1]
if domain.nil?
log_return("Domain should be specified. #{args}")
else
dom_file = get_module_conf("domains.conf")
format = (args[2].nil? ? "shell" : args[2].strip)
val = hestia_get_file_key_pair(dom_file, domain)
result = Hash.new
result["RUBY"] = val
hestia_print_array_of_hashes(result, format, "RUBY")
ACTION_OK
end
else
log_return("Unknown commands. #{args}")