Difference between revisions of "Command Line"

From PC2wiki
Jump to: navigation, search
m (initial version)
m (Usage: added all options section)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
The command line options for [[PC²]]
+
The command line options for [[PC²]] for [[Version 9]]
  
==Version 9==
+
These are options that can be used with the [[PC² scripts]]
 +
 
 +
==Usage==
 +
 
 +
All [[PC&sup2; scripts]] print usage using the <tt>--help</tt>
 +
command line option, for example:
 +
 
 +
pc2server --help
 +
 
 +
==All Options==
 +
 
 +
[[TBD]] - add links into descriptions
  
 
{|border="1" cellpadding="2"
 
{|border="1" cellpadding="2"
|+ [[First Server]] only
+
|+ [[Primary server]] only
 
! Option!! Description !! Example
 
! Option!! Description !! Example
 +
|-
 +
|<code>--contestpassword <pass> </code>|| specify contest password ||<code>TODOexample</code>
 +
|-
 +
|<code>--first </code>|| Unused  ||<code>TODOexample</code>
 +
|-
 +
|<code>--help </code>||command line summary||<code>--help</code>
 +
|-
 +
|<code>--ini filename </code>||  [[TBD]]  ||<code>TODOexample</code>
 +
|-
 +
|<code>--load <dir>|<file></code>||Load configuration/[[CDP]]]||<code>TODOexample</code>
 +
|-
 +
|<code>--login <login> </code>||User Login name ||<code>TODOexample</code>
 +
|-
 +
|<code>--nogui </code>||non-GUI mode, console output only||<code>TODOexample</code>
 +
|-
 +
|<code>--password <pass> </code>|| User login password ||<code>TODOexample</code>
 +
|-
 +
|<code>--remoteServer <remoteHostname> </code>|| Secondary server  ||<code>TODOexample</code>
 +
|-
 +
|<code>--proxyme  </code>|| Secondary server with proxy option  ||<code>TODOexample</code>
 +
|-
 +
|<code>--server </code>|| Start as server ||<code>TODOexample</code>
 +
|-
 +
|<code>--skipini </code>||  [[TBD]]  ||<code>TODOexample</code>
 +
|-
 +
|<code>--ui classname</code>||  specify startup class ||<code>TODOexample</code>
 +
|-
 +
|<code>-F filename </code>||  Load command lie options from file ||<code>TODOexample</code>
 
|-
 
|-
 
|<code>--contestpassword </code> ||[[Contest password]]||<code>--contestpassword pass </code>
 
|<code>--contestpassword </code> ||[[Contest password]]||<code>--contestpassword pass </code>
Line 11: Line 50:
 
|}
 
|}
  
 +
==Login/Password options==
  
 
{|border="1" cellpadding="2"
 
{|border="1" cellpadding="2"
|+ [[Server]] only
 
 
! Option!! Description !! Example
 
! Option!! Description !! Example
 
|-
 
|-
|<code>--server</code>||this option must be specified when logging as a server||<code>--server</code>
+
|<code>--login [[Login name|Login]]</code>||[[Login name]]||<code>--login server1</code><br> <code>--login team2</code><br>
 +
|-
 +
|<code>--password [[Password]]</code>||[[Password]]||<code>--password [[Password]]</code>
 +
|-
 
|}
 
|}
  
 +
===Examples===
 +
 +
This will attempt to login account team3 with the password <tt>passone</tt>.
 +
 +
pc2team --login team3 --password passone
  
 +
This will attempt to login account team3 with the password <tt>team3</tt> (A [[joe account]])
 +
 +
pc2team --login team3
 +
 +
==Primary server Options==
  
 
{|border="1" cellpadding="2"
 
{|border="1" cellpadding="2"
 +
|+ [[Primary server]] only
 
! Option!! Description !! Example
 
! Option!! Description !! Example
 
|-
 
|-
|<code>--login [[Login name|Login]]</code>||[[Login name]]||<code>--login server1</code><br> <code>--login team2</code><br>
+
|<code>--contestpassword </code> ||[[Contest password]]||<code>--contestpassword pass </code>
|-
 
|<code>--password [[Password]]</code>||[[Password]]||<code>--password [[Password]]</code>
 
 
|-
 
|-
 
|}
 
|}
 +
 +
===Examples===
 +
 +
This will attempt to start a [[Primary server]] with contest password contest33
 +
login account site1 with the password <tt>site1</tt>.
 +
 +
pc2server --login site1 --contestpassword contest33
 +
 +
This will attempt to login account site2 with the password <tt>sitepass2</tt>.
 +
 +
pc2server --login site2 --password sitepass2
 +
 +
==-F option==
 +
 +
Loading command line options from a properties file.
 +
 +
The -F option is a security feature. Under most Unix systems the complete command line is listed when using a <tt>ps </tt>or similar command revealing login ids and passwords. Using the -F option, login ids and passwords can be stored in a text file. Note that the command line options are not limited to login and password options; any command line option can be stored in the specified text file.
 +
 +
The -F can be used with any pc2 program (See [[PC&sup2; scripts]] for list of programs).
 +
 +
===Example===
 +
If this command line was used:
 +
pc2server --nogui --contestpassword cpass --login site1 --password site1pass
 +
One could alternatively use the -F option:
 +
pc2server -F secure.properties
 +
 +
where secure.properties contains
 +
 +
#
 +
# Command line for non GUI server
 +
#
 +
--nogui
 +
--contestpassword cpass
 +
--login site1
 +
--password site1pass
 +
 +
In the file blank lines and lines starting with a # are ignored.
 +
Each command line option must be on a different line.
 +
 +
==--load option==
 +
 +
The server --load option will load a configuration from a [[CDP]].  The --load option
 +
will only load the CDP into an "empty" server (a server that has not been previously
 +
loaded or configured).
 +
 +
See [[Load Contest Configuration]] article for more details about --load option.
 +
 +
Example
 +
 +
  pc2server --nogui --contestpassword cpass --login site1 --password site1pass --load /home/pc2/cdp
 +
 +
==--remoteServer option==
 +
 +
Example that uses mainserver.acme.com:62002 as the primary server
 +
 +
pc2server --nogui --contestpassword cpass --login site3 --password site1pass --remoteServer mainserver.acme.com:62002
 +
 +
 +
===--proxyme option===
 +
 +
The proxyme option is identical to [server] proxy=yes in the [[pc2v9.ini]] file.
 +
 +
Example that uses mainserver.acme.com:62002 as the primary server and proxy for this site.
 +
 +
pc2server --nogui --contestpassword cpass --login site3 --password site1pass --remoteServer mainserver.acme.com:62002 --proxyme
 +
 +
==See Also==
 +
* [[Primary server]]
 +
* [[Secondary server]]
 +
* [[PC&sup2; scripts]]

Latest revision as of 07:29, 31 August 2017

The command line options for PC² for Version 9

These are options that can be used with the PC² scripts

Usage

All PC² scripts print usage using the --help command line option, for example:

pc2server --help

All Options

TBD - add links into descriptions

Primary server only
Option Description Example
--contestpassword <pass> specify contest password TODOexample
--first Unused TODOexample
--help command line summary --help
--ini filename TBD TODOexample
<file> Load configuration/CDP] TODOexample
--login <login> User Login name TODOexample
--nogui non-GUI mode, console output only TODOexample
--password <pass> User login password TODOexample
--remoteServer <remoteHostname> Secondary server TODOexample
--proxyme Secondary server with proxy option TODOexample
--server Start as server TODOexample
--skipini TBD TODOexample
--ui classname specify startup class TODOexample
-F filename Load command lie options from file TODOexample
--contestpassword Contest password --contestpassword pass

Login/Password options

Option Description Example
--login Login Login name --login server1
--login team2
--password Password Password --password Password

Examples

This will attempt to login account team3 with the password passone.

pc2team --login team3 --password passone

This will attempt to login account team3 with the password team3 (A joe account)

pc2team --login team3

Primary server Options

Primary server only
Option Description Example
--contestpassword Contest password --contestpassword pass

Examples

This will attempt to start a Primary server with contest password contest33 login account site1 with the password site1.

pc2server --login site1 --contestpassword contest33

This will attempt to login account site2 with the password sitepass2.

pc2server --login site2 --password sitepass2

-F option

Loading command line options from a properties file.

The -F option is a security feature. Under most Unix systems the complete command line is listed when using a ps or similar command revealing login ids and passwords. Using the -F option, login ids and passwords can be stored in a text file. Note that the command line options are not limited to login and password options; any command line option can be stored in the specified text file.

The -F can be used with any pc2 program (See PC² scripts for list of programs).

Example

If this command line was used:

pc2server --nogui --contestpassword cpass --login site1 --password site1pass

One could alternatively use the -F option:

pc2server -F secure.properties

where secure.properties contains

#
# Command line for non GUI server
#
--nogui
--contestpassword cpass
--login site1
--password site1pass

In the file blank lines and lines starting with a # are ignored. Each command line option must be on a different line.

--load option

The server --load option will load a configuration from a CDP. The --load option will only load the CDP into an "empty" server (a server that has not been previously loaded or configured).

See Load Contest Configuration article for more details about --load option.

Example

 pc2server --nogui --contestpassword cpass --login site1 --password site1pass --load /home/pc2/cdp

--remoteServer option

Example that uses mainserver.acme.com:62002 as the primary server

pc2server --nogui --contestpassword cpass --login site3 --password site1pass --remoteServer mainserver.acme.com:62002


--proxyme option

The proxyme option is identical to [server] proxy=yes in the pc2v9.ini file.

Example that uses mainserver.acme.com:62002 as the primary server and proxy for this site.

pc2server --nogui --contestpassword cpass --login site3 --password site1pass --remoteServer mainserver.acme.com:62002 --proxyme

See Also