Verlihub Utilities

RoLex edited this page Jan 13, 2018 · 6 revisions

Verlihub Command Line Arguments

These are all available options that you can use with this script:

-i, --install                         Configure Verlihub for a new hub
-r, --run     [path_to_dbconfig]      Run the hub from the given dbconfig path
-q, --restart [path_to_dbconfig]      Restart the hub from the given dbconfig path
-s, --stop    [path_to_dbconfig]      Stop the hub from the given dbconfig path
-t, --status  [path_to_dbconfig]      Check if hub is running or not
-g, --geoip                           Update GeoIP
-a, --autoload                        Load plugin automatically when start the hub
     -l, --list                              Show list of available plugins
     -n, --on                                Run plugin automatically with hub
     -f, --off                               Disable auto load of plugin
     -d, --configdir  [path_to_dbconfig]     Specify the hub with location of dbconfig file. Optional
-u, --adduser <nick> <password> <class> [path_to_dbconfig]    Register a new user in the database
-c, --clean   [path_to_dbconfig]                      Clean kicklist, banlist, unbanlist, iplog, stats and messages tables
-w, --backup  <destination_path> [path_to_dbconfig]   Make backup of database from the given dbconfig path
-t, --restore <path_to_sql>      [path_to_dbconfig]   Import the given SQL file in the database for given dbconfig path
-v, --version                         Print version information
-h, --help                            Show this help

Type vh --help to show this output.

To obtain the complete guide of this utility script in your shell you can read the man page for this command man vh

Option --install

The option allows you to install a new hub. For detailed explanation please read Manual.Installation.

Option --run

This option allows you to start the hub and run VerliHub as a daemon. VerliHub config folder can be omitted. If folder is omitted then the script will automatically try to guess them; the following folders will be searched in this order:

  • value of VERLIHUB_CFG enviroment variable
  • /etc/verlihub
  • PREFIX/etc/verlihub where PREFIX is the path where you installed VerliHub
  • ./.verlihub
  • /.verlihub ( means your home directory)

If no directory will be found, the script will return an error.

For example if you want to start the hub with config folder /etc/verlihub, then use:

vh --run /etc/verlihub

Option --restart

This option allows you to restart a running hub. You can also provide a VerliHub config folder; please refer to Utility.vh#Option_--run for more information.

Option --stop

This option allows you to stop a running hub. You can also provide a VerliHub config folder; please refer to Utility.vh#Option_--run for more information.

Option --status

This option allows you to check if a hub is running or not. You can also provide a VerliHub config folder; please refer to Utility.vh#Option_--run for more information.

Option --geoip

This option allows you to update GeoIP DAT file in /usr/share/GeoIP folder. Script will download tarball from Maxmind server and it will unpack in that folder. You can also use this command in crontab, please see How-to.Update-GeoIP-automatically page.

Option --autoload

This option allow you to create symbolic link in the hub config folder to load plugins automatically with VerliHub. You have to specify one the following options:

  • --list: show a list of installed plugins and their status
  • --on: load plugin automatically
  • --off: disabled autoload feature of plugin

You can specify the config directory using --configdir option; this is optional, please refer to Utility.vh#Option_--run for more information.

Option --adduser

This option allows you to add a new user to the hub. You have to specify the following extra options to create a new user:

  • --nickname <nickname>: the nickname of the user
  • --password <password>: the password of the user. This is optional and it can be provided by the user.
  • --class <class>: the class of the user. Allowed values are -1, 0, 1, 2, 3, 4, 5, 10. Please refer to Manual.users-and-privileges for more information about those classes.
  • --configdir <path_to_dbconfig>: VerliHub config folder. This is optional; please refer to Utility.vh#Option_--run for more information.

Option --clean

This option will ask you if you want to clean up kicklist, banlist, unbanlist, pi_iplog, pi_messages and pi_stats tables (plugins tables will be dropped only if they exists) using TRUNCATE method. This means that all data in these tables will be removed.

Option --backup

This option allows you to make a backup of database that VerliHub uses to store registered users, triggers, configuration, etc. You have to specify a folder where you want to store the backup. For example if you want to save it to /home/foobar type:

vh --backup /home/foobar

You can also provide a VerliHub config folder; please refer to Utility.vh#Option_--run for more information.

Option --restore

This option allows you to restore a backup created with Utility.vh#Option_--backup or with other MySQL utility. You have to specify the path to sql file that contains the backup. or example if you want to restore verlihub_backup.sql that is located at /home/foobar type:

vh --restore /home/foobar/verlihub_backup.sql

You can also provide a VerliHub config folder; please refer to Utility.vh#Option_--run for more information.

Option --version

This option prints version information about this script and VerliHub.

Option --help

This option shows help for this script as shown at the begging of this page.

VerliHub Gui

These are all available options that you can use with this script:

 -i, --install                 Configure Verlihub for a new hub
 -r, --run                     Run the hub from the given dbconfig path
 -q, --restart                 Restart the hub from the given dbconfig path
 -s, --stop                    Stop the hub from the given dbconfig path
 -t, --status                  Check if hub is running or not
 -v, --version                 Print version information
 -h, --help                    Show this help

Type vh_gui --help to show this output.

Option --install

The option allows you to install a new hub. For detailed explanation please read Manual.Installation.

Option --run

This option allows you to start the hub and run VerliHub as a daemon. You can choose the VerliHub config folder using the up/down keyword arrows:

image

If the hub is already running the script will return an error:

image

Otherwise, if you have permissions to write in the config folder and no error happens, you will see the following windows:

image

Option --restart

This option allows you to restart a running hub; please refer to Utility.vh_gui#Option_--run for more information.

Option --stop

This option allows you to stop a running hub; please refer to Utility.vh_gui#Option_--run for more information.

Option --status

This option allows you to check if a hub is running or not; please refer to Utility.vh_gui#Option_--run for more information.

Option --version

This option prints version information about this script and VerliHub.

Option --help

This option shows help for this script as shown at the begging of this page.

This script contains less features than vh and it is thought to provide more support for those users who do not like interactions with the command line. For other advanced options such as DB backup/restore or GeoIp update please refer to Utility.vh.

Verlihub MultiHub

It is possible to run multi instances of Verlihub at same time. To make things easier it is a script called μ-Verlihub (multi-Verlihub) that helps you to manage some hubs. The script is called vhm.

Remeber that only root user can use this script.

These are all available options that you can use with this script:

μ-Verlihub (multi-Verlihub)
This is a utility to run, restart and stop hubs with Verlihub, usage:
--list                  Show a list of added hubs
--add                   Add new hub
--del       [ID]        Delete an hub
--run       [ID]        Run a single hub or all hubs togheter
--stop      [ID]        Stop a single hub or all hubs togheter
--restart   [ID]        Restart a single hub or all hubs togheter
--version               Print version information
--help                  Show this help

Type vhm --help to show this output.

To obtain the complete guide of this utility script in your shell you can read the man page for this command (man vhm)

Option --list

The option shows you a list of added hubs and their status:

image

First number show the identifier (ID) of the entry. Green color means that hub is running, red color that hub is stopped.

Option --add

The option allows you to add a new hub to config file. Just run

vhm --add

and follow the instructions.

image

Remember that you cannot add more hubs with same config path.

Option --del

This option allows you to delete an entry. You can specify the entry ID to delete as parameter or run the script without any option. In the later case the script proposes you a list of the hubs and it asks to choose the entry you want to delete.

Option --run, --stop, --restart

These options allow you to start, stop or restart hubs. You can specify an entry ID as parameter or run the script option only. In the later case the script proposes you a list of the hubs and it asks to choose the entry you want to manager.

You can also use the character A to select all hubs.

image

Option --version

This option prints version information about this script and VerliHub.

Option --help

This option shows help for this script as shown at the begging of this page.

Structure of config file

All hubs are stored inside a config file called verlihub.conf and it is located in /etc/ folder. This file is structured like /etc/passwd file. Each line represents an hub entry and one line contains the following values separeted by a comma (;):

CONFIG_PATH:NICKNAME:PROCESS_OWNER:DATE

where

  • CONFIG_PATH is the complete path to dbconfig file of the hub
  • NICKNAME is just a reference to the hub (for i.e. the hub owner)
  • PROCESS_OWNER is the username that should run the process (you can use this value if you want to allow server access with different users)
  • DATE the unix timestamp of the last changes

Please do not edit this file directly but use the options of vhm script.

Verlihub Registration Importer

This script will import registered users from PtokaX, YnHub and Aquila to VerliHub reglist table. These are all available options that you can use with this script:

--ptokax    <RegisteredUsers.xml> <Profiles.xml>    <path_to_dbconfig> Convert registrations from PtokaX to VerliHub
--ynhub     <accounts.xml> <profiles.xml> <path_to_dbconfig>            Convert registrations from YnHub to VerliHub
--aquila    <Aquila.xml> <path_to_dbconfig>                             Convert registrations from Aquila to VerliHub
--version       Print version information
--help          Show this help

Type vh_regimporter --help to show this output.

To use converter you need libxml2 installed

To obtain the complete guide of this utility script in your shell you can read the man page for this command (man vh_regimporter)

Option --ptokax

To convert registered users you will need two XML files:

  • RegisteredUsers.xml: contains registered users with nickname, password and profile ID
  • Profiles.xml: contains information about profiles

First script will ask you to map PtokaX profiles with VerliHub classes. Then program will automatically add all users in reglist tables. If a MySQL query will failed you will see a error about no-added user.

Option --ynhub

To convert registered users you will need two XML files:

  • accounts.xml: contains registered users with nickname, password and other information
  • profiles.xml: contains information about profiles

This option will also import:

  • Registration date
  • OP creator
  • Last login

First script will ask you to map YnHub profiles with VerliHub classes. Then program will automatically add all users in reglist tables. If a MySQL query will failed you will see a error about no-added user.

Option --aquila

To convert registered users you will need only Aquila.xml file that is generated in configuration directory of the hub. This option will also import:

  • Registration date
  • OP creator
  • Last login
  • Last IP

First script will ask you to map Aquila profiles with VerliHub classes. Then program will automatically add all users in reglist tables. If a MySQL query will failed you will see a error about no-added user.

Verlihub Migration

These are all available options that you can use with this script:

 --clean                              Clean directory from old binary/script files
 --hub        <path_to_dbconfig>      Update hub database with the given dbconfig path
 --help                               Show this help

Type vh_migration_0.9.8eto1.0 --help to show this output.

You should use this script ONLY if you have updated VerliHub from version 0.9.8e to 1.0.

Before running the script make a backup copy of your database, then run it and restart the hub.

Option --clean

The option allows you to clean the VerliHub installation folder from following old utility script file:

  • vh_getcfg
  • vh_getdb
  • vh_install
  • vh_regnick
  • vh_restart
  • vh_runhub
  • vh_setup
  • vh_trigger
  • verlihub_config

Some of these scripts was unusefull and others have been merged and optimized in vh script.

Option --hub

The option allows you to clean the database from unused variables from SetupList table:

  • lang variables: ban_reason ban_remaining ban_expired ban_for ban_permanently ban_type ban_removed ban_by ban_types_nickip ban_types_ip ban_types_nick ban_types_iprange ban_types_host1 ban_types_host2 ban_types_host3 ban_types_share ban_types_email ban_types_prefix ban_types_rhost1, timeout_key timeout_nick timeout_login timeout_myinfo timeout_flush timeout_setpass
  • config variables: tag_min_version_* tag_max_version_* save_lang chat_msg_long chat_msg_lines pwd_cannot pwd_can pwd_min pwd_success pwd_set_error pwd_setup ip nick user host ip_range because op type not_in_userlist error success wrong_dc_tag tag_max_slots tag_min_slots tag_min_limit tag_min_ls_ratio tag_no_sock msg_downgrade msg_upgrade msg_topic_set msg_topic_reset autoreg_nick_prefix autoreg_already_reg autoreg_success autoreg_error timeout_any operation_timeout msg_chat_onoff msg_change_pwd msg_banned msg_hub_full msg_nick_prefix msg_downgrade msg_upgrade msg_replace_ban login_share_min login_share_max autoreg_min_share search_share_min ctm_share_min max_attempts_threshold

It will also copy the new help files and make other stuff.

Pisg Configuration

You can generate config file and statistics for your hub using (http://pisg.sourceforge.net/ "Pisg"). After installing the Manual.Plugins#Pisg you need to install pigs software. Download last version from http://pisg.sourceforge.net/index.php?page=download and unpack it in your home folder or wherever you want. Now to configure pisg we have created a script called vh_pisg that is installed with plugin.

This is the output if you type vh_pisg --help:

vh_pisg.in
This is a utility script for configure pisg for DC++, usage:
   --generate   Generate pisg config file
   --cron       Install a new cron job to collect stats
   --help       Show this help

First you need to generate pisg config file using:

vh_pisg --generate

This will ask you some information:

  • Config path: the path to config of the hub you want to generate statistic (where is located dbconfig file)
  • Location of generated HTML file: pisg will generate a index.html page with all graphs. Pisg need to put this file in the public folder of web server
  • Path to pisg: the completed path to pisg file (this the folder where you extracted the tarball)

If the file has been correctly generated now you need to run pisg at least every hour using crontab to regenerate index.html file. In this case you can use always vh_pisg:

vh_pisg --cron

type again config path and the script will install new cron job with your current user for every hour. If you want to generate stats more frequently you can edit the job using:

crontab -e
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.