Using Svctl

From ShockvoiceWiki

Jump to: navigation, search

ATTENTION: The svctl interface in Shockvoice is deprecated. It will stay in the server but it will not be developed any further. Please consider to use the SOAP interface instead.

Contents

Using svctl.exe

Administrate your server by using the "svctl.exe"

With "svctl.exe“ we are providing a seperate interface to administrate your Shockvoice server by feeding him with commands straight from the command shell. For Linux servers you have to use the "svctl“ Shell script. This interface can be used to give the Shockvoice server directly commands from your own website or adminpanel.

Our serverspecs:

domain: example.com

login: admin

pass: admin

serverport: 8040 → config.xml

port for hosterinterface: 8020 → config.xml


Overview of commands accepted by "svctl.exe“:

Shockvoice Hoster Interface Client v0.8.2

Usage:svctl <login> <password> <host> <port> <command>

Commands:

server_stop <server-id>

server_start <server-id>

server_create <name> <description> <password> <max-users> <port> <no-anonymous> <active> <homepage> <register> <list-on-svn>

server_modify <server-id> <name> <description> <max-users> <port> <no-anonymous> <active> <homepage> <register> <list-on-svn>

server_clone <server-id> <newname> <newport>

server_delete <server-id>

server_reload <server-id>

server_stats

plugin_activate <server-id> <plugin-id>

plugin_deactivate <server-id> <plugin-id>

user_create <name> <password> <is-admin> <server-id>

user_modify <user-id> <password> <is-admin> <server-id>

user_delete <user-id>

user_clone <user-id> <server-id> <username> <password>

Response:server_create / server_clone / user_create will respond with the ID of the new server/user.

all other commands will respond with message codes or 'FAILED:<reason>'


Examples:

We want to check how many instances are running.

svctl <login> <password> <host> <port> <server_stats>


svctl.exe admin admin example.com 8020 server_stats


Found mono binary in /usr/bin/mono .. good

Connected to example.com:8020


337 Server stats start.

338 "Mainserver" 1 256 0

339 Server stats end.


As you can see we have our "Mainserver“ up and running with id 1 and 256 slots.


How can I deactivate/activate an instance?

svctl <login> <password> <host> <port> <server_stop> <server-id>


svctl.exe admin admin example.com 8020 server_stop 1

This command will stop our "Mainserver“ (with server-id 1), but the main process is still running.


svctl.exe admin admin example.com 8020 server_start 1

This will start the "Mainserver“ again.


How to create a new server instance?

svctl <login> <password> <host> <port> <server_create> <name> <description> <password> <max-users> <port> <no-anonymous> <active> <homepage> <register> <list-on-svn>

<name> - servername to display (text)

<description> - server description optional (text)

<password> - server password optional (text or blank)

<max-users> - how many available slots (digits)

<port> - server port (digits)

<no-anonymous> - are anonymous user allowed? ('0' for no or '1' for yes)

<active> - server active? ('0' for no or '1' for yes)

<homepage> - server homepage to display optional (text/URL)

<register> - register server on SVNetwork? ('0' for no or '1' for yes)

<list-on-svn> - list server on SVNetwork? ('0' for no or '1' for yes)


svctl.exe admin admin example.com 8020 server_create 'Second instance' 'My second server instance' 'mypassword' '50' '8021' '1' '1' 'http://www.example.com' '1' '1'


As you can see we have some options that require either a '1' for „yes“ or '0' for „no“. Just leave the optional fields blank if you don't want to set them, but don't forget the quotes!

The server_stats should now show something like this:


svctl.exe admin admin example.com 8020 server_stats


Found mono binary in /usr/bin/mono .. good

Connected to example.com:8020

337 Server stats start.

338 "Mainserver" 1 256 0

338 "Second instance" 2 50 0

339 Server stats end.


The "Second instance“ is up and running with server-id 2


Cloning a server.

svctl <login> <password> <host> <port> <server_clone> <server-id> <newname> <newport>


svctl.exe admin admin example.com 8020 server_clone '2' 'Clone instance' '8022'


svctl.exe admin admin example.com 8020 server_stats

Found mono binary in /usr/bin/mono .. good

Connected to example.com:8020


337 Server stats start.

338 "Mainserver" 1 256 0

338 "testbude" 2 50 0

338 "Clone instance" 3 50 0

339 Server stats end.


Activate/deactivate plugins

svctl <login> <password> <host> <port> <plugin_activate> <server-id> <plugin-id>

<plugin-id> - so far the following plugin-ids are available sv_chat, sv_query, sv_vmail, sv_wboard. The names of plugin-ids can be found in the "''Manage server plugins''“ menu inside the client administration panel.


svctl.exe admin admin example.com 8020 plugin_activate '2' 'sv_wboard'

or

svctl.exe admin admin example.com 8020 plugin_deactivate '2' 'sv_wboard'


How to create/modify/delete a user using the hosterinterface?

svctl <login> <password> <host> <port> <user_create> <name> <password> <is-admin> <server-id>

<name> - user login name

<password> - user password

<is-admin> - user is admin? ('0' for no or '1' for yes)


svctl.exe admin admin example.com 8020 user_create 'testuser' 'mypass' '0' '2'

Found mono binary in /usr/bin/mono .. good

Connected to 127.0.0.1:8020


420 2 (where 2 is the user-id)


svctl <login> <password> <host> <port> <user_modify> <user-id> <password> <is-admin> <server-id>

<user-id> - get the user-id directly from the database or get the ID form the "''Manage users''“ menu inside the client administration panel. This can be used to reset user passwords.


svctl.exe admin admin example.com 8020 user_modify '2' 'mynewpass' '0' '2'


svctl <login> <password> <host> <port> <user_delete> <user-id>

svctl.exe admin admin example.com 8020 user_delete '2'


Cloning a user

svctl <login> <password> <host> <port> <user_clone> <user-id> <server-id> <username> <password>

This can be usefull if you have created a standard adminuser with limited access on the "Mainserver“ and you want to create other users with the same access on a different instance.


svctl.exe admin admin example.com 8020 user_clone '3' '2' 'instanceadmin' 'mypass'

This will clone the user with "user-id“ 3 to serverinstance 2 with username "instanceadmin“ and password "mypass

Personal tools