Class: Arkrb::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/arkrb/cli.rb

Instance Method Summary collapse

Instance Method Details

#backupObject



67
68
69
# File 'lib/arkrb/cli.rb', line 67

def backup
  ark_server(options[:instance]).backup!
end

#broadcast(message) ⇒ Object



109
110
111
# File 'lib/arkrb/cli.rb', line 109

def broadcast(message)
  ark_server(options[:instance]).broadcast message
end

#checkmodupdatesObject



127
128
129
# File 'lib/arkrb/cli.rb', line 127

def checkmodupdates
  ark_server(options[:instance]).mod_updates_available?
end

#checkupdateObject



121
122
123
# File 'lib/arkrb/cli.rb', line 121

def checkupdate
  ark_server(options[:instance]).update_available?
end

#disablemod(mod_id) ⇒ Object



85
86
87
# File 'lib/arkrb/cli.rb', line 85

def disablemod(mod_id)
  ark_server(options[:instance]).disable_mod mod_id
end

#enablemod(mod_id) ⇒ Object



79
80
81
# File 'lib/arkrb/cli.rb', line 79

def enablemod(mod_id)
  ark_server(options[:instance]).enable_mod mod_id
end

#install(name = nil) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/arkrb/cli.rb', line 14

def install(name = nil)
  if options[:list] || name.nil?
    arkmanager_status = (find_executable('arkmanager').nil?) ? 'Not Installed'.red : 'Installed'.green
    ark_install_status = (ark_installed?(options[:instance])) ? 'Installed'.green : 'Not Installed'.red
    # arkmanager_status = 'Not Installed'.red
    printf format("%-20s Status %21s\n", 'APP_NAME', 'Description')
    print_status('ark_manager', arkmanager_status, 'Installs ark-server-tools; Install with: ark_rb install tools')
    print_status('ark_server', ark_install_status, 'Installs the ark server; Install with: ark_rb install ark')
  end
  unless name.nil?
    case name.to_sym
      when :arkmanager, :ark_manager, :tools
        Arkrb.install.server_tools
      when :ark
        Arkrb.install.ark(options[:instance], false)
      else
        # do nothing
    end
  end
end

#installmod(mod_id) ⇒ Object



91
92
93
# File 'lib/arkrb/cli.rb', line 91

def installmod(mod_id)
  ark_server(options[:instance]).install_mod mod_id
end

#rcon(command) ⇒ Object



115
116
117
# File 'lib/arkrb/cli.rb', line 115

def rcon(command)
  ark_server(options[:instance]).rcon_cmd command
end

#reinstallmod(mod_id) ⇒ Object



103
104
105
# File 'lib/arkrb/cli.rb', line 103

def reinstallmod(mod_id)
  ark_server(options[:instance]).reinstall_mod mod_id
end

#restartObject



49
50
51
# File 'lib/arkrb/cli.rb', line 49

def restart
  ark_server(options[:instance]).restart!
end

#saveworldObject



73
74
75
# File 'lib/arkrb/cli.rb', line 73

def saveworld
  ark_server(options[:instance]).save_world!
end

#startObject



37
38
39
# File 'lib/arkrb/cli.rb', line 37

def start
  ark_server(options[:instance]).start!
end

#statusObject



55
56
57
# File 'lib/arkrb/cli.rb', line 55

def status
  ark_server(options[:instance]).status!
end

#stopObject



43
44
45
# File 'lib/arkrb/cli.rb', line 43

def stop
  ark_server(options[:instance]).stop!
end

#uninstallmod(mod_id) ⇒ Object



97
98
99
# File 'lib/arkrb/cli.rb', line 97

def uninstallmod(mod_id)
  ark_server(options[:instance]).uninstall_mod mod_id
end

#updateObject



61
62
63
# File 'lib/arkrb/cli.rb', line 61

def update
  ark_server(options[:instance]).update!
end