diff --git a/bin/v_add_sys_ip b/bin/v_add_sys_ip index 9e4a73a0..b92b9eef 100755 --- a/bin/v_add_sys_ip +++ b/bin/v_add_sys_ip @@ -1,8 +1,13 @@ #!/bin/bash # info: add system ip address -# arguments: ip mask [interface] [user] [ip_status] [ip_name] +# options: ip mask [interface] [user] [ip_status] [ip_name] # -# The function adds ip address into a system including rc scripts. +# The function adds ip address into a system. It also creates rc scripts. You +# can specify ip name which will be used as root domain for temporary aliases. +# For example, if you set a1.myhosting.com as name, each new domain created on +# this ip will automaticaly receive alias $domain.a1.myhosting.com. Of course +# you must have wildcard record *.a1.myhosting.com pointed to ip. This feature +# is very handy when customer wants to test domain before dns migration. #----------------------------------------------------------# diff --git a/bin/v_change_sys_config_value b/bin/v_change_sys_config_value index 7cf04251..11e99692 100755 --- a/bin/v_change_sys_config_value +++ b/bin/v_change_sys_config_value @@ -1,5 +1,10 @@ #!/bin/bash -# info: changing sysconfig value +# info: change sysconfig value +# options: key value +# +# The function is for changing main config settings such as COMPANY_NAME or +# COMPANY_EMAIL and so on. + #----------------------------------------------------------# # Variable&Function # @@ -29,8 +34,8 @@ format_validation 'key' check_ckey=$(grep "^$key='" $V_CONF/vesta.conf) if [ -z "$check_ckey" ]; then echo "Error: key not found" - log_event 'debug' "$E_KEY_INVALID $V_EVENT" - exit $E_KEY_INVALID + log_event 'debug' "$E_INVALID $V_EVENT" + exit $E_INVALID fi diff --git a/bin/v_change_sys_ip_name b/bin/v_change_sys_ip_name index d2f07b01..d0c425d1 100755 --- a/bin/v_change_sys_ip_name +++ b/bin/v_change_sys_ip_name @@ -1,5 +1,9 @@ #!/bin/bash -# info: changing ip name +# info: change ip name +# options: ip name +# +# The function for changing dns domain associated with ip. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_change_sys_ip_owner b/bin/v_change_sys_ip_owner index d3761a0b..ac269fc2 100755 --- a/bin/v_change_sys_ip_owner +++ b/bin/v_change_sys_ip_owner @@ -1,5 +1,9 @@ #!/bin/bash -# info: changing ip owner +# info: change ip owner +# options: ip user +# +# The function of changing ip address ownership. + #----------------------------------------------------------# # Variable&Function # @@ -9,7 +13,6 @@ ip=$1 user=$2 - # Importing variables source $VESTA/conf/vars.conf source $V_CONF/vesta.conf diff --git a/bin/v_change_sys_ip_status b/bin/v_change_sys_ip_status index 21795dd0..9999609e 100755 --- a/bin/v_change_sys_ip_status +++ b/bin/v_change_sys_ip_status @@ -1,5 +1,9 @@ #!/bin/bash -# info: changing ip status +# info: change ip status +# options: ip ip_status +# +# The function of changing an ip address's status. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_delete_sys_ip b/bin/v_delete_sys_ip index 02738f18..de0821c6 100755 --- a/bin/v_delete_sys_ip +++ b/bin/v_delete_sys_ip @@ -1,5 +1,10 @@ #!/bin/bash -# info: deleting system ip +# info: delete system ip +# options: ip +# +# The function for deleting a system ip. It does not allow to delete first ip +# on interface and do not allow to delete ip which is used by a web domain. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_list_sys_config b/bin/v_list_sys_config index 41b2d231..808193b7 100755 --- a/bin/v_list_sys_config +++ b/bin/v_list_sys_config @@ -1,5 +1,9 @@ #!/bin/bash -# info: listing system config +# info: list system config +# options: [format] +# +# The function for obtaining the list of system parameters. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_list_sys_interfaces b/bin/v_list_sys_interfaces index fe5e4d39..f35fb080 100755 --- a/bin/v_list_sys_interfaces +++ b/bin/v_list_sys_interfaces @@ -1,5 +1,9 @@ #!/bin/bash -# info: listing system interfaces +# info: list system interfaces +# options: [format] +# +# The function for obtaining the list of network interfaces. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_list_sys_ip b/bin/v_list_sys_ip index 6cfa1bc6..98744c1f 100755 --- a/bin/v_list_sys_ip +++ b/bin/v_list_sys_ip @@ -1,5 +1,9 @@ #!/bin/bash -# info: listing system ip +# info: list system ip +# options: ip [format] +# +# The function for getting the list of system ip parameters. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_list_sys_ips b/bin/v_list_sys_ips index f98831d2..c381da53 100755 --- a/bin/v_list_sys_ips +++ b/bin/v_list_sys_ips @@ -1,5 +1,9 @@ #!/bin/bash -# info: listing system ips +# info: list system ips +# options: [format] +# +# The function for obtaining the list of system ip's. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_list_sys_rrd b/bin/v_list_sys_rrd index 26a1f979..433230da 100755 --- a/bin/v_list_sys_rrd +++ b/bin/v_list_sys_rrd @@ -1,5 +1,9 @@ #!/bin/bash -# info: listing available system rrd charts +# info: list system rrd charts +# options: [format] +# +# List available rrd graphics, its titles and paths. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_sys_ip b/bin/v_update_sys_ip index cda6a866..1b2f240c 100755 --- a/bin/v_update_sys_ip +++ b/bin/v_update_sys_ip @@ -1,15 +1,19 @@ #!/bin/bash -# info: adding system ip +# info: update system ip +# options: [owner] [ip_status] +# +# The function scans configured ip in the system and register them with vesta +# internal database. This call is intended for use on vps servers, where ip is +# set by hypervizor. + #----------------------------------------------------------# # Variable&Function # #----------------------------------------------------------# # Argument defenition -owner=$1 -ip_status=$2 -owner=${3-vesta} -ip_status=${4-shared} +owner=${1-vesta} +ip_status=${2-shared} # Importing variables source $VESTA/conf/vars.conf @@ -27,13 +31,13 @@ source $V_FUNC/domain.func check_args '0' "$#" '[owner] [ip_status]' # Checking owner -if [ ! -z "$owner" ]; then +if [ ! -z "$1" ]; then format_validation 'owner' is_user_valid "$owner" fi # Checking ip_status -if [ ! -z "$ip_status" ]; then +if [ ! -z "$2" ]; then format_validation 'ip_status' fi diff --git a/bin/v_update_sys_queue b/bin/v_update_sys_queue index de209f47..7d451898 100755 --- a/bin/v_update_sys_queue +++ b/bin/v_update_sys_queue @@ -1,5 +1,13 @@ #!/bin/bash -# info: updating system queue +# info: update system queue +# options: pipe +# +# This function is responsible queue processing. Restarts of services, +# scheduled backups, web log parsing and other heavy resource consuming +# operations are handled by this script. It helps to optimize system behaviour. +# In a nutshell Apache will be restarted only once even if 10 domains are +# added or deleted. + #----------------------------------------------------------# # Variable&Function # @@ -8,7 +16,7 @@ pipe=$1 # Importing system enviroment as we run this script -# mostly by cron wich not read it by itself +# mostly by cron wich not read it by itself source /etc/profile.d/vesta.sh # Importing variables diff --git a/bin/v_update_sys_rrd b/bin/v_update_sys_rrd index ab6f63ce..fb7549ce 100755 --- a/bin/v_update_sys_rrd +++ b/bin/v_update_sys_rrd @@ -1,5 +1,10 @@ #!/bin/bash -# info: updating system rrd charts +# info: update system rrd charts +# options: period +# +# The script is wrapper for all rrd functions. It updates all +# v_update_sys_rrd_* at once. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_sys_rrd_ftp b/bin/v_update_sys_rrd_ftp index a6d35ca1..506926c8 100755 --- a/bin/v_update_sys_rrd_ftp +++ b/bin/v_update_sys_rrd_ftp @@ -1,5 +1,9 @@ #!/bin/bash -# info: updating ftp rrd +# info: update ftp rrd +# options: period +# +# The function is for updating ftpd rrd database and graphic. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_sys_rrd_httpd b/bin/v_update_sys_rrd_httpd index a1a65ce9..97e835f8 100755 --- a/bin/v_update_sys_rrd_httpd +++ b/bin/v_update_sys_rrd_httpd @@ -1,5 +1,9 @@ #!/bin/bash -# info: updating httpd rrd +# info: update httpd rrd +# options: period +# +# The function is for updating apache rrd database and graphic. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_sys_rrd_la b/bin/v_update_sys_rrd_la index c4f5f8e4..d4e60a9a 100755 --- a/bin/v_update_sys_rrd_la +++ b/bin/v_update_sys_rrd_la @@ -1,5 +1,9 @@ #!/bin/bash -# info: updating load average rrd +# info: update load average rrd +# options: period +# +# The function is for updating load average rrd database and graphic. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_sys_rrd_mem b/bin/v_update_sys_rrd_mem index a988339f..124ba3c4 100755 --- a/bin/v_update_sys_rrd_mem +++ b/bin/v_update_sys_rrd_mem @@ -1,5 +1,9 @@ #!/bin/bash -# info: updating memory rrd +# info: update memory rrd +# options: period +# +# The function is for updating memory rrd database and graphic. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_sys_rrd_mysql b/bin/v_update_sys_rrd_mysql index f28885c4..7e7238c9 100755 --- a/bin/v_update_sys_rrd_mysql +++ b/bin/v_update_sys_rrd_mysql @@ -1,5 +1,9 @@ #!/bin/bash -# info: updating MySQL rrd +# info: update MySQL rrd +# options: period +# +# The function is for updating mysql rrd database and graphic. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_sys_rrd_net b/bin/v_update_sys_rrd_net index 479462f3..0c48a46b 100755 --- a/bin/v_update_sys_rrd_net +++ b/bin/v_update_sys_rrd_net @@ -1,5 +1,9 @@ #!/bin/bash -# info: updating network rrd +# info: update network rrd +# options: period +# +# The function is for updating network usage rrd database and graphic. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_sys_rrd_nginx b/bin/v_update_sys_rrd_nginx index fbd1fac3..eafb47a1 100755 --- a/bin/v_update_sys_rrd_nginx +++ b/bin/v_update_sys_rrd_nginx @@ -1,5 +1,9 @@ #!/bin/bash -# info: updating httpd rrd +# info: update nginx rrd +# options: period +# +# The function is for updating nginx rrd database and graphic. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_sys_rrd_pgsql b/bin/v_update_sys_rrd_pgsql index 8fa0797e..278b7023 100755 --- a/bin/v_update_sys_rrd_pgsql +++ b/bin/v_update_sys_rrd_pgsql @@ -1,5 +1,9 @@ #!/bin/bash -# info: updating PostgreSQL rrd +# info: update PostgreSQL rrd +# options: period +# +# The function is for updating postgresql rrd database and graphic. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_sys_rrd_ssh b/bin/v_update_sys_rrd_ssh index 9a39a4ee..a577b78c 100755 --- a/bin/v_update_sys_rrd_ssh +++ b/bin/v_update_sys_rrd_ssh @@ -1,5 +1,9 @@ #!/bin/bash -# info: updating ssh rrd +# info: update ssh rrd +# options: period +# +# The function is for updating ssh rrd database and graphic. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_sys_vesta b/bin/v_update_sys_vesta index 32a1529e..a749ade6 100755 --- a/bin/v_update_sys_vesta +++ b/bin/v_update_sys_vesta @@ -1,8 +1,10 @@ #!/bin/bash -# info: updating vesta after rpm update +# info: update vesta after rpm update +# options: version +# +# The function is runs as rpm update trigger. It pulls shell script from vesta +# server and runs it. -# warn: please note that this scritp should be runned -# by yum or rpm only #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_user_bill b/bin/v_update_user_bill index bdcf0596..55d468e6 100755 --- a/bin/v_update_user_bill +++ b/bin/v_update_user_bill @@ -116,6 +116,7 @@ for user in $user_list; do v_str="$v_str U_MAIL_DOMAINS='$U_MAIL_DOMAINS' IP_OWNED='$IP_OWNED'" v_str="$v_str U_DISK_WEB_DOMAINS='$U_DISK_WEB_DOMAINS'" v_str="$v_str U_BANDWIDTH_WEB_DOMAINS='$U_BANDWIDTH_WEB_DOMAINS'" + v_str="$v_str U_CRON_JOBS" # Updating user billing log billing="$V_USERS/$user/billing.log"