summaryrefslogtreecommitdiff
path: root/man/minecctl.xml
blob: 62c8925710260fd63b8b54cebf6eb71f169e521a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<!-- SPDX-License-Identifier: GPL-2.0 -->

<refentry id="minecctl">

  <refentryinfo>
    <title>minecctl</title>
    <productname>minecproxy</productname>
    <authorgroup>
      <author>
        <contrib>Developer</contrib>
        <firstname>David</firstname>
        <surname>Härdeman</surname>
      </author>
    </authorgroup>
  </refentryinfo>

  <refmeta>
    <refentrytitle>minecctl</refentrytitle>
    <manvolnum>1</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>minecctl</refname>
    <refpurpose>Interact with Minecraft servers</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>minecctl</command>
      <arg choice="opt" rep="repeat">OPTIONS</arg>
      <arg choice="opt" rep="plain">COMMAND</arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Description</title>
    <para>
      <command>minecctl</command> may be used to communicate with, and
      control, Minecraft servers. It can also be used to perform various
      checks on <command>minecproxy</command> server configuration files.
    </para>
    <para>
      Commands are usually performed on servers defined by corresponding
      configuration files in the <command>minecproxy</command> configuration
      directory, but server connection details can also be set manually
      to control servers which have no configuration files (see options
      <option>-p</option>, <option>-r</option> and <option>-m</option> below).
    </para>
  </refsect1>

  <refsect1>
    <title>Commands</title>
    <para>The following commands are understood:</para>
    <variablelist>

      <varlistentry>
	<term><command>list</command></term>
	<listitem><para>
	  List all known servers (i.e. servers with configuration files).
	</para></listitem>
      </varlistentry>

      <varlistentry>
	<term><command>lint</command></term>
	<listitem><para>
	  Check the validity of all known server configuration files.
	</para></listitem>
      </varlistentry>

      <varlistentry>
	<term><command>info</command> <optional>SERVER</optional></term>
	<listitem><para>
	  Show information about <replaceable>SERVER</replaceable>
	  (or all known servers if <replaceable>SERVER</replaceable>
	  is not specified). Note that the server needs to be running. 
	</para></listitem>
      </varlistentry>

      <varlistentry>
	<term><command>status</command> <optional>SERVER</optional></term>
	<listitem><para>
	  Check if <replaceable>SERVER</replaceable> is running and reachable
	  via various methods (<acronym>rcon</acronym>, 
	  <application>minecraft</application> protocol and
	  <application>systemd</application>).
	  If <replaceable>SERVER</replaceable> is not specified, it must
	  be defined via command line options, see options <option>-r</option>
	  and <option>-m</option> below.
	</para></listitem>
      </varlistentry>

      <varlistentry>
	<term><command>stop</command> <optional>SERVER</optional></term>
	<listitem><para>
	  Stop <replaceable>SERVER</replaceable>
	  (if <replaceable>SERVER</replaceable> is not specified, it must
	  be defined via command line options, see option <option>-r</option> 
	  below). Note that servers with active players will not be
	  stopped unless forced (i.e. if option <option>-f</option> is used).
	</para></listitem>
      </varlistentry>

      <varlistentry>
	<term><command>stopall</command></term>
	<listitem><para>
	  Similar to <command>stop</command> but stops <emphasis>all</emphasis>
	  known servers (including any server specified using the
	  <option>-r</option> option). Like <command>stop</command>,
	  servers with active players will not be stopped unless
	  option <option>-f</option> is used.
	</para></listitem>
      </varlistentry>

      <varlistentry>
	<term><command>pcount</command> <optional>SERVER</optional></term>
	<listitem><para>
	  Get the current player count for <replaceable>SERVER</replaceable>
	  using either the <acronym>rcon</acronym> or
	  <application>minecraft</application> protocol
	  (if <replaceable>SERVER</replaceable> is not specified, it must
	  be defined via command line options, see options <option>-r</option>
	  and <option>-m</option> below).
	</para></listitem>
      </varlistentry>

      <varlistentry>
	<term><command>console</command> <optional>SERVER</optional></term>
	<listitem><para>
	  Provides an interactive <acronym>rcon</acronym> command
	  line for <replaceable>SERVER</replaceable>
	  (if <replaceable>SERVER</replaceable> is not specified, it must
	  be defined via command line options, see option <option>-r</option>
	  below).
	</para></listitem>
      </varlistentry>

      <varlistentry>
	<term><command>cmd</command> <optional>SERVER</optional> <replaceable>CMD</replaceable></term>
	<listitem><para>
	  Send <replaceable>CMD</replaceable> to
	  <replaceable>SERVER</replaceable> via the 
	  <acronym>rcon</acronym> protocol
	  (if <replaceable>SERVER</replaceable> is not specified, it must
	  be defined via command line options, see option <option>-r</option>
	  below). Note that <replaceable>CMD</replaceable> will be interpreted
	  as a single command, so e.g. <quote><command>minecctl cmd
	  <replaceable>SERVER</replaceable> time set day</command></quote>
	  will be interpreted as a single command.
	</para></listitem>
      </varlistentry>

      <varlistentry>
	<term><command>cmds</command> <optional>SERVER</optional> <replaceable>CMDS</replaceable></term>
	<listitem><para>
	  Similar to <command>cmd</command> above, but allows multiple commands
	  to be sent to the server. Use quotes to separate commands, e.g.
	  <quote><command>minecctl cmds <replaceable>SERVER</replaceable>
	  <quote>time set day</quote>
	  <quote>say Enjoy the sun</quote></command></quote>.
	</para></listitem>
      </varlistentry>

      <varlistentry>
	<term><optional>SERVER</optional> <replaceable>CMD</replaceable></term>
	<listitem><para>
	  Shorthand for <quote><command>cmd <optional>SERVER</optional>
	  <replaceable>CMD</replaceable></command></quote>.
	</para></listitem>
      </varlistentry>

      <varlistentry>
	<term><optional>SERVER</optional></term>
	<listitem><para>
	  Shorthand for 
	  <quote><command>console <optional>SERVER</optional></command></quote>.
	</para></listitem>
      </varlistentry>

    </variablelist>
  </refsect1>

  <refsect1>
    <title>Options</title>
    <para>The following options are understood:</para>
    <variablelist>

      <varlistentry>
        <term><option>-p</option></term>
        <term><option>--rcon-password=<replaceable>PASSWORD</replaceable></option></term>
        <listitem><para>
	  Use <replaceable>PASSWORD</replaceable> when
	  connecting via <acronym>rcon</acronym> to a server. If not set,
	  the password (if any) from the <replaceable>SERVER</replaceable>
	  configuration file will be used.
        </para></listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-r</option></term>
        <term><option>--rcon-address=<replaceable>ADDRESS</replaceable></option></term>
        <listitem><para>
	  Use <replaceable>ADDRESS</replaceable> when connecting via
	  <acronym>rcon</acronym> to a server. If not set, the address
	  (if any) from the <replaceable>SERVER</replaceable> configuration
	  file will be used.
        </para></listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-m</option></term>
        <term><option>--mc-address=<replaceable>ADDRESS</replaceable></option></term>
        <listitem><para>
	  Use <replaceable>ADDRESS</replaceable> when connecting via
	  the <application>minecraft</application> protocol to a server
	  (only used for some commands such as <command>pcount</command>,
	  <command>status</command> and <command>ping</command>). 
	  If not set, the address (if any) from the 
	  <replaceable>SERVER</replaceable> configuration file will be used.
        </para></listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-c</option></term>
        <term><option>--cfgdir=<replaceable>DIR</replaceable></option></term>
        <listitem><para>
	  Look for <replaceable>SERVER</replaceable> configuration files
	  in <replaceable>DIR</replaceable> instead of the default
	  directory (<filename class="directory">/etc/minecproxy/</filename>).
	  <!-- FIXME: Add replacement var -->
        </para></listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-f</option></term>
        <term><option>--force</option></term>
        <listitem><para>
	  Normally <command>minecctl</command> will check the current
	  player count and refuse to stop a server with active players.
	  This option means that the given server(s) will be stopped
	  even if there are active players.
        </para></listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-v</option></term>
        <term><option>--verbose</option></term>
        <listitem><para>
	  Output extra logging information.
        </para></listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-d</option></term>
        <term><option>--debug</option></term>
        <listitem><para>
	  Output debugging information (implies <option>-v</option>).
        </para></listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-h</option></term>
        <term><option>--help</option></term>
        <listitem><para>
	  Prints a list of valid options/commands and exits.
        </para></listitem>
      </varlistentry>

    </variablelist>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <citerefentry><refentrytitle>minecproxy</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
      <citerefentry><refentrytitle>minecproxy.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
      <citerefentry><refentrytitle>minecproxy.mcserver</refentrytitle><manvolnum>5</manvolnum></citerefentry>
    </para>
  </refsect1>

</refentry>