If anyone knows how to compile this C program to run and work on Windows, please let me know.
I modified the original source code by [AZY]Zyrain primarily to remove the password from the command-line arguments due to it being a security risk exposing the password in plain view by anyone able to view the process list. I also made a few other modifications to my liking.
NAME
rcon – Execute rcon commands
SYNOPSIS
rcon <-f “filename.ini”> [-a IPNumber] [-p Port] <command>
DESCRIPTION
Linux command line utility to send rcon commands.
Any command line parameter will take precedence over the corresponding option in the INI file.
OPTIONS
-f -a -p and command are all necessary. However, only -f and command are required as command-line arguments. If address and port are in the file, it is not required to pass them as arguments.
-? Shows the usage syntax and quits.
-v Enables verbose mode which means more detailed messages.
-f “filename.ini” Location to .ini file containing at least the password.
-a IPNumber IP Address of the rcon server. This option is not needed if added to the .ini file.
-p Port Port on the rcon server. This option is not needed if added to the .ini file.
command rcon command to send to the rcon server.
FILE FORMAT
EXAMPLES
Run a DoExit command:
Run a DoExit command and use the address and port defined in ini file:
Run a Broadcast message command using an island-instance ini file:
Run a SaveWorld command using a ragnarok-instance ini file:
EXIT CODES
0 = Good
1 = Unknown option
2 = Missing file parameter
3 = Missing command parameter
4 = Missing address parameter/config
5 = Missing port parameter/config
6 = Invalid file or format
7 = Connect failed
8 = Error sending password
9 = Could not authenticate
1. = Command send error
SEE ALSO
www.ryanschulze.net – https://www.ryanschulze.net/archives/1052
SOURCE CODE
If you do not have the gcc compiler installed, you can do so with these commands for Ubuntu/Debian:
Download the source code directly to your server using these commands:
Once you have the rcon.c code downloaded to your Linux server, you can compile it using this command:
Copy the utility where the system can find it.
You also want to setup your configuration file.
Copy the man page where the system can find it.
Then you can access the manual by typing the following from anywhere:
Do not forget to set file access permissions appropriate to your system.
Here we come to an end for ARK: Survival Evolved RCON Command-Line Utility hope you enjoy it. If you think we forget something to include or we should make an update to the post let us know via comment, and we will fix it asap! Thanks and have a great day!
- Check All ARK: Survival Evolved Posts List
good job !
only problem i had is that cut n past of cat command for creating ini file wont work on my windows PC so i was not sure about intended ini file format
gprochas@Valheim-pro:~$ cat /etc/rcon.ini
[rcon]
password=adminpro
ipaddress=127.0.0.1
port=32320
so i guess its linux vs windows CR/CRLF problem
maybe you just add what ini should look like …
now all is fine and i can add rcon commands to my bash script to backup savegame files while ARK Server is running so i can force a save before i do backup
thank you – CLI rcon was the missing piece in my puzzle …