diff --git a/bin/v_add_cron_job b/bin/v_add_cron_job index 531af4f5..e7bbec07 100755 --- a/bin/v_add_cron_job +++ b/bin/v_add_cron_job @@ -1,6 +1,6 @@ #!/bin/bash # info: add cron job -# arguments: user min hour day month wday command [job] +# options: user min hour day month wday command [job] # # The function adds a job to cron daemon. When executing commands, any output # is mailed to user's email if parameter REPORTS is set to 'yes'. @@ -78,6 +78,9 @@ sync_cron_jobs # Vesta # #----------------------------------------------------------# +# Increasing cron value +increase_user_value "$user" '$U_CRON_JOBS' + # Adding task to the vesta pipe restart_schedule 'cron' diff --git a/bin/v_add_db_base b/bin/v_add_db_base index adfd8e74..e84a5421 100755 --- a/bin/v_add_db_base +++ b/bin/v_add_db_base @@ -1,6 +1,6 @@ #!/bin/bash # info: add database -# arguments: user db db_user db_password type [host] [encoding] +# options: user db db_user db_password type [host] [encoding] # # The function creates the database concatenating username and user_db. # Supported yypes of databases you can get using v_list_sys_config script. diff --git a/bin/v_add_db_host b/bin/v_add_db_host index 033533e3..e5db5b4b 100755 --- a/bin/v_add_db_host +++ b/bin/v_add_db_host @@ -1,6 +1,6 @@ #!/bin/bash # info: add new database server -# arguments: type host port db_user db_password [max_db] [tpl] +# options: type host port db_user db_password [max_db] [tpl] # # The function add new database server to the server pool. It supports local # and remote database servers, which is useful for clusters. By adding a host diff --git a/bin/v_add_dns_domain b/bin/v_add_dns_domain index 8e65eaa9..38baf6d0 100755 --- a/bin/v_add_dns_domain +++ b/bin/v_add_dns_domain @@ -1,6 +1,6 @@ #!/bin/bash # info: add dns domain -# arguments: user domain ip [template] [exp] [soa] [ttl] +# options: user domain ip [template] [exp] [soa] [ttl] # # The function adds DNS zone with records defined in the template. If the exp # argument isn't stated, the expiration date value will be set to next year. diff --git a/bin/v_add_dns_domain_record b/bin/v_add_dns_domain_record index 542ad5ff..bfe34c9e 100755 --- a/bin/v_add_dns_domain_record +++ b/bin/v_add_dns_domain_record @@ -1,6 +1,6 @@ #!/bin/bash # info: add dns domain record -# arguments: user domain record type value [id] +# options: user domain record type value [id] # # The call is used for adding new DNS record. Complex records of TXT, MX and # SRV types can be used by a filling in the 'value' argument. The function also 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_add_user b/bin/v_add_user index 3fa90340..c2eb6af1 100755 --- a/bin/v_add_user +++ b/bin/v_add_user @@ -156,6 +156,7 @@ U_WEB_SSL='0' U_DNS_DOMAINS='0' U_DATABASES='0' U_MAIL_DOMAINS='0' +U_CRON_JOBS='0' DATE='$V_DATE'" > $V_USERS/$user/user.conf # Hiding password diff --git a/bin/v_change_cron_job b/bin/v_change_cron_job index d223966c..7183e469 100755 --- a/bin/v_change_cron_job +++ b/bin/v_change_cron_job @@ -1,6 +1,6 @@ #!/bin/bash # info: change cron job -# arguments: user job min hour day month wday command +# options: user job min hour day month wday command # # The function is used for changing existing job. It fully replace job # parameters with new one but with same id. diff --git a/bin/v_change_db_password b/bin/v_change_db_password index fb54aab4..b96d2bbb 100755 --- a/bin/v_change_db_password +++ b/bin/v_change_db_password @@ -1,6 +1,6 @@ #!/bin/bash # info: change database user password -# arguments: user db_name db_password +# options: user db_name db_password # # The function for changing database user password to a database. It uses the # full name of database as argument. diff --git a/bin/v_change_dns_domain_exp b/bin/v_change_dns_domain_exp index 273b7fe0..69067aa1 100755 --- a/bin/v_change_dns_domain_exp +++ b/bin/v_change_dns_domain_exp @@ -1,6 +1,6 @@ #!/bin/bash # info: change dns domain expiriation date -# arguments: user domain exp +# options: user domain exp # # The function of changing the term of expiration domain's registration. The # serial number will be refreshed automatically during update. diff --git a/bin/v_change_dns_domain_ip b/bin/v_change_dns_domain_ip index 3ceb8eac..21501e8b 100755 --- a/bin/v_change_dns_domain_ip +++ b/bin/v_change_dns_domain_ip @@ -1,6 +1,6 @@ #!/bin/bash # info: change dns domain ip address -# arguments: user domain ip +# options: user domain ip # # The function for changing the main ip of DNS zone. diff --git a/bin/v_change_dns_domain_record b/bin/v_change_dns_domain_record index 58a6e668..f2c11f02 100755 --- a/bin/v_change_dns_domain_record +++ b/bin/v_change_dns_domain_record @@ -1,6 +1,6 @@ #!/bin/bash # info: change dns domain record -# arguments: user domain id record type value +# options: user domain id record type value # # The function for changing DNS record. diff --git a/bin/v_change_dns_domain_soa b/bin/v_change_dns_domain_soa index ec978482..abebef28 100755 --- a/bin/v_change_dns_domain_soa +++ b/bin/v_change_dns_domain_soa @@ -1,6 +1,6 @@ #!/bin/bash # info: change dns domain soa record -# arguments: user domain soa +# options: user domain soa # # The function for changing SOA record. This type of records can not be # modified by v_change_dns_domain_record call. diff --git a/bin/v_change_dns_domain_tpl b/bin/v_change_dns_domain_tpl index 2ed4c6f7..8d1d2268 100755 --- a/bin/v_change_dns_domain_tpl +++ b/bin/v_change_dns_domain_tpl @@ -1,6 +1,6 @@ #!/bin/bash # info: change dns domain template -# arguments: user domain +# options: user domain # # The function for changing the template of records. By updating old records # will be removed and new records will be generated in accordance with diff --git a/bin/v_change_dns_domain_ttl b/bin/v_change_dns_domain_ttl index 7af31615..7d7b14e0 100755 --- a/bin/v_change_dns_domain_ttl +++ b/bin/v_change_dns_domain_ttl @@ -1,6 +1,6 @@ #!/bin/bash # info: change dns domain ttl -# arguments: user domain ttl +# options: user domain ttl # # The function for chaning the time to live TTL parameter for all records. 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_change_user_package b/bin/v_change_user_package index 1b0c7f71..794cbdcf 100755 --- a/bin/v_change_user_package +++ b/bin/v_change_user_package @@ -84,6 +84,7 @@ BACKUPS='$BACKUPS' WEB_TPL='$WEB_TPL' SUSPENDED='$SUSPENDED' CONTACT='$CONTACT' +RKEY='$RKEY' REPORTS='$REPORTS' IP_OWNED='$IP_OWNED' U_DIR_DISK='$U_DIR_DISK' @@ -94,6 +95,7 @@ U_WEB_SSL='$U_WEB_SSL' U_DNS_DOMAINS='$U_DNS_DOMAINS' U_DATABASES='$U_DATABASES' U_MAIL_DOMAINS='$U_MAIL_DOMAINS' +U_CRON_JOBS='$U_CRON_JOBS' DATE='$DATE'" > $V_USERS/$user/user.conf } diff --git a/bin/v_change_web_domain_sslcert b/bin/v_change_web_domain_sslcert index 1a36e7f7..923c3476 100755 --- a/bin/v_change_web_domain_sslcert +++ b/bin/v_change_web_domain_sslcert @@ -23,10 +23,10 @@ source $V_FUNC/domain.func #----------------------------------------------------------# # Checking arg number -check_args '3' "$#" 'user domain certificate' +check_args '3' "$#" 'user domain ssl_dir' # Checking argument format -format_validation 'user' 'domain' 'ssl' +format_validation 'user' 'domain' 'ssl_dir' # Checking web system is enabled is_system_enabled 'web' diff --git a/bin/v_change_web_domain_sslhome b/bin/v_change_web_domain_sslhome index 2a493d3d..44f65836 100755 --- a/bin/v_change_web_domain_sslhome +++ b/bin/v_change_web_domain_sslhome @@ -23,7 +23,7 @@ source $V_FUNC/domain.func #----------------------------------------------------------# # Checking arg number -check_args '3' "$#" 'user domain sslhome' +check_args '3' "$#" 'user domain ssl_home' # Checking argument format format_validation 'user' 'domain' diff --git a/bin/v_delete_cron_job b/bin/v_delete_cron_job index 4e8406be..f867df9a 100755 --- a/bin/v_delete_cron_job +++ b/bin/v_delete_cron_job @@ -1,6 +1,6 @@ #!/bin/bash # info: delete cron job -# arguments: user job +# options: user job # # The function deletes cron job. @@ -58,6 +58,9 @@ sync_cron_jobs # Vesta # #----------------------------------------------------------# +# Decreasing cron value +decrease_user_value "$user" '$U_CRON_JOBS' + # Adding task to the vesta pipe restart_schedule 'cron' diff --git a/bin/v_delete_db_base b/bin/v_delete_db_base index f22e5406..67e36459 100755 --- a/bin/v_delete_db_base +++ b/bin/v_delete_db_base @@ -1,6 +1,6 @@ #!/bin/bash # info: delete database -# arguments: user database +# options: user database # # The function for deleting the database. If database user have access to # another database, he will not be deleted. diff --git a/bin/v_delete_db_dbases b/bin/v_delete_db_dbases index 29bafcbd..5c3fc7ab 100755 --- a/bin/v_delete_db_dbases +++ b/bin/v_delete_db_dbases @@ -1,6 +1,6 @@ #!/bin/bash # info: delete user databases -# arguments: user +# options: user # # The function deletes all user databases. diff --git a/bin/v_delete_db_host b/bin/v_delete_db_host index dfc8ef20..5e69ac49 100755 --- a/bin/v_delete_db_host +++ b/bin/v_delete_db_host @@ -1,6 +1,6 @@ #!/bin/bash # info: delete database serve -# arguments: type host +# options: type host # # The function for deleting the database host from vesta configuration. It will # be deleted if there are no databases created on it only. diff --git a/bin/v_delete_dns_domain b/bin/v_delete_dns_domain index 232c9371..090dffc0 100755 --- a/bin/v_delete_dns_domain +++ b/bin/v_delete_dns_domain @@ -1,6 +1,6 @@ #!/bin/bash # info: delite dns domain -# arguments: user domain +# options: user domain # # The function for deleting DNS domain. By deleting it all records will also be # deleted. diff --git a/bin/v_delete_dns_domain_record b/bin/v_delete_dns_domain_record index aa37c2c9..35325f4d 100755 --- a/bin/v_delete_dns_domain_record +++ b/bin/v_delete_dns_domain_record @@ -1,6 +1,6 @@ #!/bin/bash # info: delete dns record -# arguments: user domain id +# options: user domain id # # The function for deleting a certain record of DNS zone. diff --git a/bin/v_delete_dns_domains b/bin/v_delete_dns_domains index 2351c8ba..1583b3c2 100755 --- a/bin/v_delete_dns_domains +++ b/bin/v_delete_dns_domains @@ -1,6 +1,6 @@ #!/bin/bash # info: delete dns domains -# arguments: user +# options: user # # The function for deleting all users DNS domains. 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_get_dns_domain_value b/bin/v_get_dns_domain_value index b776b13a..ab0716de 100755 --- a/bin/v_get_dns_domain_value +++ b/bin/v_get_dns_domain_value @@ -1,6 +1,6 @@ #!/bin/bash # info: get dns domain value -# arguments: user domain key +# options: user domain key # # The function for getting a certain DNS domain parameter. diff --git a/bin/v_list_cron_jobs b/bin/v_list_cron_jobs index 1deac5c9..b9ee6998 100755 --- a/bin/v_list_cron_jobs +++ b/bin/v_list_cron_jobs @@ -1,6 +1,6 @@ #!/bin/bash # info: list user cron jobs -# arguments: user [format] +# options: user [format] # # The function for obtaining the list of all users cron jobs. diff --git a/bin/v_list_db_base b/bin/v_list_db_base index 4a95a594..93ffe0f1 100755 --- a/bin/v_list_db_base +++ b/bin/v_list_db_base @@ -1,6 +1,6 @@ #!/bin/bash # info: list database -# arguments: user database [format] +# options: user database [format] # # The function for obtaining of all database's parameters. diff --git a/bin/v_list_db_bases b/bin/v_list_db_bases index 628bcce9..33200c42 100755 --- a/bin/v_list_db_bases +++ b/bin/v_list_db_bases @@ -1,6 +1,6 @@ #!/bin/bash # info: listing data bases -# arguments: user [format] +# options: user [format] # # The function for obtaining the list of all user's databases. diff --git a/bin/v_list_db_host b/bin/v_list_db_host index fda87178..7b4ab032 100755 --- a/bin/v_list_db_host +++ b/bin/v_list_db_host @@ -1,6 +1,6 @@ #!/bin/bash # info: list database host -# arguments: type host [format] +# options: type host [format] # # The function for obtaining host's database parameters. diff --git a/bin/v_list_db_hosts b/bin/v_list_db_hosts index 11964ad2..f7c271a8 100755 --- a/bin/v_list_db_hosts +++ b/bin/v_list_db_hosts @@ -1,6 +1,6 @@ #!/bin/bash # info: list data base servers -# arguments: type [format] +# options: type [format] # # The function for obtaining the list of all hosts of the same databases' type. diff --git a/bin/v_list_dns_domain b/bin/v_list_dns_domain index 72b5fee8..2f6bfd96 100755 --- a/bin/v_list_dns_domain +++ b/bin/v_list_dns_domain @@ -1,6 +1,6 @@ #!/bin/bash # info: list dns domain -# arguments: user domain [format] +# options: user domain [format] # # The function for getting all DNS domain's parameters. diff --git a/bin/v_list_dns_domains b/bin/v_list_dns_domains index 7a76d0bc..5734f5a4 100755 --- a/bin/v_list_dns_domains +++ b/bin/v_list_dns_domains @@ -1,6 +1,6 @@ #!/bin/bash # info: list dns domains -# arguments: user [format] +# options: user [format] # # The function for obtaining all DNS domains of a user. diff --git a/bin/v_list_dns_template b/bin/v_list_dns_template index 1654c7b5..d0961dff 100755 --- a/bin/v_list_dns_template +++ b/bin/v_list_dns_template @@ -1,6 +1,6 @@ #!/bin/bash # info: list dns template -# arguments: template [format] +# options: template [format] # # The function for obtaining the DNS template parameters. diff --git a/bin/v_list_dns_templates b/bin/v_list_dns_templates index bdfecd29..5b55d10c 100755 --- a/bin/v_list_dns_templates +++ b/bin/v_list_dns_templates @@ -1,6 +1,6 @@ #!/bin/bash # info: list dns templates -# arguments: [format] +# options: [format] # # The function for obtaining the list of all DNS templates available. 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_list_user b/bin/v_list_user index 18917afa..9a1ea029 100755 --- a/bin/v_list_user +++ b/bin/v_list_user @@ -94,7 +94,7 @@ fields='$USER $FNAME $LNAME $PACKAGE $WEB_DOMAINS $WEB_SSL $WEB_ALIASES $DATABASES $MAIL_DOMAINS $MAIL_BOXES $MAIL_FORWARDERS $DNS_DOMAINS $DISK_QUOTA $BANDWIDTH $NS $SHELL $BACKUPS $WEB_TPL $SUSPENDED $CONTACT $RKEY $REPORTS $IP_OWNED $U_DIR_DISK $U_DISK $U_BANDWIDTH $U_WEB_DOMAINS - $U_WEB_SSL $U_DNS_DOMAINS $U_DATABASES $U_MAIL_DOMAINS $DATE' + $U_WEB_SSL $U_DNS_DOMAINS $U_DATABASES $U_MAIL_DOMAINS $U_CRON_JOBS $DATE' # Listing user case $format in diff --git a/bin/v_list_users b/bin/v_list_users index 1a12b697..56b46bb7 100755 --- a/bin/v_list_users +++ b/bin/v_list_users @@ -91,7 +91,7 @@ fields="$fields \$DNS_DOMAINS \$DISK_QUOTA \$BANDWIDTH \$NS \$SHELL \$BACKUPS" fields="$fields \$WEB_TPL \$SUSPENDED \$CONTACT \$RKEY \$REPORTS \$IP_OWNED" fields="$fields \$U_DIR_DISK \$U_DISK \$U_BANDWIDTH \$U_WEB_DOMAINS" fields="$fields \$U_WEB_SSL \$U_DNS_DOMAINS \$U_DATABASES \$U_MAIL_DOMAINS" -fields="$fields \$DATE" +fields="$fields \$U_CRON_JOBS \$DATE" # Listing domains case $format in diff --git a/bin/v_rebuild_cron_jobs b/bin/v_rebuild_cron_jobs index c7782aa8..c85116e4 100755 --- a/bin/v_rebuild_cron_jobs +++ b/bin/v_rebuild_cron_jobs @@ -1,6 +1,6 @@ #!/bin/bash # info: rebuild cron jobs -# arguments: user +# options: user # # The function rebuilds system cron config file for specified user. diff --git a/bin/v_rebuild_dns_domains b/bin/v_rebuild_dns_domains index 37f0724e..b351b102 100755 --- a/bin/v_rebuild_dns_domains +++ b/bin/v_rebuild_dns_domains @@ -1,6 +1,6 @@ #!/bin/bash # info: rebuild dns domains -# arguments: user +# options: user # # The function rebuilds BIND configuration files for all dns domains. diff --git a/bin/v_restart_cron b/bin/v_restart_cron index 642e2028..cf1e7582 100755 --- a/bin/v_restart_cron +++ b/bin/v_restart_cron @@ -1,6 +1,6 @@ #!/bin/bash # info: restart cron service -# arguments: none +# options: none # # The function tells crond service to reread its configuration files. diff --git a/bin/v_restart_dns b/bin/v_restart_dns index a5c8540d..1f3cd75a 100755 --- a/bin/v_restart_dns +++ b/bin/v_restart_dns @@ -1,6 +1,6 @@ #!/bin/bash # info: restart dns service -# arguments: none +# options: none # # The function tells BIND service to reload dns zone files. diff --git a/bin/v_suspend_cron_job b/bin/v_suspend_cron_job index 702ca2b2..1cde5448 100755 --- a/bin/v_suspend_cron_job +++ b/bin/v_suspend_cron_job @@ -1,6 +1,6 @@ #!/bin/bash # info: suspend cron job -# arguments: user job +# options: user job # # The function suspends a certain job of the cron scheduler. diff --git a/bin/v_suspend_cron_jobs b/bin/v_suspend_cron_jobs index 879068ae..39f2c0f7 100755 --- a/bin/v_suspend_cron_jobs +++ b/bin/v_suspend_cron_jobs @@ -1,6 +1,6 @@ #!/bin/bash # info: Suspending sys cron jobs -# arguments: user +# options: user # # The function suspends all user cron jobs. diff --git a/bin/v_suspend_db_base b/bin/v_suspend_db_base index 4d520496..f31d6cd0 100755 --- a/bin/v_suspend_db_base +++ b/bin/v_suspend_db_base @@ -1,6 +1,6 @@ #!/bin/bash # info: suspend database -# arguments: user database +# options: user database # # The function for suspending a certain user database. diff --git a/bin/v_suspend_db_bases b/bin/v_suspend_db_bases index 187df520..ec6a6d45 100755 --- a/bin/v_suspend_db_bases +++ b/bin/v_suspend_db_bases @@ -1,6 +1,6 @@ #!/bin/bash # info: suspend databases -# arguments: user +# options: user # # The function for suspending of all databases of a single user. diff --git a/bin/v_suspend_dns_domain b/bin/v_suspend_dns_domain index ed602251..6acdc12b 100755 --- a/bin/v_suspend_dns_domain +++ b/bin/v_suspend_dns_domain @@ -1,6 +1,6 @@ #!/bin/bash # info: suspend dns domain -# arguments: user domain +# options: user domain # # The function suspends a certain user's domain. diff --git a/bin/v_suspend_dns_domains b/bin/v_suspend_dns_domains index d5c109e1..9588ce5a 100755 --- a/bin/v_suspend_dns_domains +++ b/bin/v_suspend_dns_domains @@ -1,6 +1,6 @@ #!/bin/bash # info: suspend dns domains -# arguments: user +# options: user # # The function suspends all user's DNS domains. diff --git a/bin/v_unsuspend_cron_job b/bin/v_unsuspend_cron_job index 01818733..fc633e2e 100755 --- a/bin/v_unsuspend_cron_job +++ b/bin/v_unsuspend_cron_job @@ -1,6 +1,6 @@ #!/bin/bash # info: unuspend cron job -# arguments: user job +# options: user job # # The function unsuspen certain cron job. diff --git a/bin/v_unsuspend_cron_jobs b/bin/v_unsuspend_cron_jobs index dcaa6a65..ad4e3c3d 100755 --- a/bin/v_unsuspend_cron_jobs +++ b/bin/v_unsuspend_cron_jobs @@ -1,6 +1,6 @@ #!/bin/bash # info: unuspend sys cron -# arguments: user +# options: user # # The function unsuspends all suspended cron jobs. diff --git a/bin/v_unsuspend_db_base b/bin/v_unsuspend_db_base index 2d46de4a..94b82afc 100755 --- a/bin/v_unsuspend_db_base +++ b/bin/v_unsuspend_db_base @@ -1,6 +1,6 @@ #!/bin/bash # info: unsuspend database -# arguments: user database +# options: user database # # The function for unsuspending database. diff --git a/bin/v_unsuspend_db_bases b/bin/v_unsuspend_db_bases index d85b7e78..49847da8 100755 --- a/bin/v_unsuspend_db_bases +++ b/bin/v_unsuspend_db_bases @@ -1,6 +1,6 @@ #!/bin/bash # info: unsuspend databases -# arguments: user +# options: user # # The function for unsuspending all user's databases. diff --git a/bin/v_unsuspend_dns_domain b/bin/v_unsuspend_dns_domain index 0676cd2e..bb749553 100755 --- a/bin/v_unsuspend_dns_domain +++ b/bin/v_unsuspend_dns_domain @@ -1,6 +1,6 @@ #!/bin/bash # info: unsuspend dns domain -# arguments: user domain +# options: user domain # # The function unsuspends a certain user's domain. diff --git a/bin/v_unsuspend_dns_domains b/bin/v_unsuspend_dns_domains index 41d9049b..421390ae 100755 --- a/bin/v_unsuspend_dns_domains +++ b/bin/v_unsuspend_dns_domains @@ -1,6 +1,6 @@ #!/bin/bash # info: unsuspend dns domains -# arguments: user +# options: user # # The function unsuspends all user's DNS domains. diff --git a/bin/v_update_db_base_disk b/bin/v_update_db_base_disk index f8bfddbe..6baa4e6b 100755 --- a/bin/v_update_db_base_disk +++ b/bin/v_update_db_base_disk @@ -1,6 +1,6 @@ #!/bin/bash # info: update database disk usage -# arguments: user database +# options: user database # # The function recalculates disk usage for speciefic database. diff --git a/bin/v_update_db_bases_disk b/bin/v_update_db_bases_disk index 4cfce5b9..91c9bbc0 100755 --- a/bin/v_update_db_bases_disk +++ b/bin/v_update_db_bases_disk @@ -1,6 +1,6 @@ #!/bin/bash # info: update databases disk usage -# arguments: user +# options: user # # The function recalculates disk usage for all user databases. 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"