From 87fcc5d83bd9a50bff67fa0f210538c7783c1529 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 10 Jan 2012 17:10:18 +0200 Subject: [PATCH] Added documentations for USER functions. --- bin/v_add_user | 13 +++++++++---- bin/v_add_user_backup | 6 +++++- bin/v_add_user_reports | 7 ++++++- bin/v_backup_user | 4 ++++ bin/v_backup_users | 9 ++++++--- bin/v_change_user_contact | 7 ++++++- bin/v_change_user_name | 6 +++++- bin/v_change_user_ns | 6 +++++- bin/v_change_user_package | 6 +++++- bin/v_change_user_password | 6 +++++- bin/v_change_user_shell | 6 +++++- bin/v_delete_user | 7 ++++++- bin/v_delete_user_ips | 6 +++++- bin/v_delete_user_reports | 7 ++++++- bin/v_get_user_value | 6 +++++- bin/v_list_user | 6 +++++- bin/v_list_user_backups | 6 +++++- bin/v_list_user_ips | 6 +++++- bin/v_list_user_ns | 6 +++++- bin/v_list_user_packages | 6 +++++- bin/v_list_users | 6 +++++- bin/v_suspend_user | 6 +++++- bin/v_unsuspend_user | 6 +++++- bin/v_update_user_backups | 6 +++++- bin/v_update_user_bill | 6 +++++- bin/v_update_user_disk | 6 +++++- 26 files changed, 138 insertions(+), 30 deletions(-) diff --git a/bin/v_add_user b/bin/v_add_user index c2eb6af18..1a2ed3ad1 100755 --- a/bin/v_add_user +++ b/bin/v_add_user @@ -1,5 +1,9 @@ #!/bin/bash -# info: adding system user +# info: add system user +# options: user password email [package] [fname] [lname] +# +# The function creates new user account. + #----------------------------------------------------------# # Variable&Function # @@ -56,10 +60,11 @@ is_package_valid "$package" package_data=$(cat $V_PKG/$package.pkg) # Checking shell -shell_conf=$(echo "$package_data"|grep 'SHELL'|cut -f 2 -d \') +shell_conf=$(echo "$package_data" | grep 'SHELL' | cut -f 2 -d \') case $shell_conf in nologin) shell='/sbin/nologin' ;; bash) shell='/bin/bash' ;; + sh) shell='/bin/bash' ;; *) shell='/sbin/nologin' ;; esac @@ -95,8 +100,8 @@ chmod -R a+x $V_HOME/$user # Checking quota if [ ! -z "$DISK_QUOTA" ] && [ "$DISK_QUOTA" != 'no' ]; then - DISK_QUOTA=$(echo "$package_data"|grep 'DISK_QUOTA' | cut -f 2 -d \') - set_quota "$user" "$DISK_QUOTA" + DISK_QUOTA=$(echo "$package_data" | grep 'DISK_QUOTA' | cut -f 2 -d \') + #$V_BIN/v_add_user_quota "$user" "$DISK_QUOTA" fi diff --git a/bin/v_add_user_backup b/bin/v_add_user_backup index 177dd4e98..470c847d7 100755 --- a/bin/v_add_user_backup +++ b/bin/v_add_user_backup @@ -1,5 +1,9 @@ #!/bin/bash -# info: schedule user backup +# info: schedule user backup creation +# options: user +# +# The function for scheduling user backup creation. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_add_user_reports b/bin/v_add_user_reports index a65925f93..a480abf84 100755 --- a/bin/v_add_user_reports +++ b/bin/v_add_user_reports @@ -1,5 +1,10 @@ #!/bin/bash -# info: adding user reports +# info: add user reports +# opions: user +# +# The script for enabling reports on cron tasks and administrative +# notifications. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_backup_user b/bin/v_backup_user index 495024c7a..a8beb299e 100755 --- a/bin/v_backup_user +++ b/bin/v_backup_user @@ -1,5 +1,9 @@ #!/bin/bash # info: backup system user with all its objects +# options: user +# +# The call is used for backing up user with all its domains and databases. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_backup_users b/bin/v_backup_users index 7ed0ff395..1a1ac0037 100755 --- a/bin/v_backup_users +++ b/bin/v_backup_users @@ -1,13 +1,16 @@ #!/bin/bash -# info: updating montly billing user report +# info: backup all users +# options: none +# +# The function backups all system users. + #----------------------------------------------------------# # Variable&Function # #----------------------------------------------------------# - # 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_change_user_contact b/bin/v_change_user_contact index 185434b0e..e8162c9dc 100755 --- a/bin/v_change_user_contact +++ b/bin/v_change_user_contact @@ -1,5 +1,9 @@ #!/bin/bash -# info: changing user contact email +# info: change user contact email +# options: user email +# +# The function for changing of e-mail associated with a certain user. + #----------------------------------------------------------# # Variable&Function # @@ -14,6 +18,7 @@ source $VESTA/conf/vars.conf source $V_CONF/vesta.conf source $V_FUNC/shared.func + #----------------------------------------------------------# # Verifications # #----------------------------------------------------------# diff --git a/bin/v_change_user_name b/bin/v_change_user_name index 86653f037..9f88eab6a 100755 --- a/bin/v_change_user_name +++ b/bin/v_change_user_name @@ -1,5 +1,9 @@ #!/bin/bash -# info: changing user nameservers +# info: change user full name +# options: user fname lname +# +# The function allow to change user's full name. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_change_user_ns b/bin/v_change_user_ns index 198a35ebd..32f364166 100755 --- a/bin/v_change_user_ns +++ b/bin/v_change_user_ns @@ -1,5 +1,9 @@ #!/bin/bash -# info: changing user nameservers +# info: change user nameservers +# options: user ns1 ns2 [ns3] [ns4] [ns5] [ns6] [ns7] [ns8] +# +# The function for changing default nameservers for speciefic user. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_change_user_package b/bin/v_change_user_package index 794cbdcfb..bed06755b 100755 --- a/bin/v_change_user_package +++ b/bin/v_change_user_package @@ -1,5 +1,9 @@ #!/bin/bash -# info: changing user package +# info: change user package +# options: user package +# +# The function changes user's hosting package. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_change_user_password b/bin/v_change_user_password index 49124c929..85ef6066c 100755 --- a/bin/v_change_user_password +++ b/bin/v_change_user_password @@ -1,5 +1,9 @@ #!/bin/bash -# info: changing user password +# info: change user password +# options: user password +# +# The function changes user's password and updates RKEY value. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_change_user_shell b/bin/v_change_user_shell index d7ee2cea4..41cfb3b0d 100755 --- a/bin/v_change_user_shell +++ b/bin/v_change_user_shell @@ -1,5 +1,9 @@ #!/bin/bash -# info: changing user shell +# info: change user shell +# options: user shell +# +# The function changes system shell of a user. Shell gives abilty to use ssh. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_delete_user b/bin/v_delete_user index c6aec9b9a..cc17cf76b 100755 --- a/bin/v_delete_user +++ b/bin/v_delete_user @@ -1,5 +1,10 @@ #!/bin/bash -# info: deliting system user +# info: delete user +# options: user +# +# This function deletes a certain user and all his resourses such as domains, +# databases, cron jobs, etc. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_delete_user_ips b/bin/v_delete_user_ips index a70fab422..9edfca041 100755 --- a/bin/v_delete_user_ips +++ b/bin/v_delete_user_ips @@ -1,5 +1,9 @@ #!/bin/bash -# info: deliting system user ips +# info: delete user ips +# options: user +# +# The function deletes all user's ip addresses. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_delete_user_reports b/bin/v_delete_user_reports index e681cd370..f01c4ffab 100755 --- a/bin/v_delete_user_reports +++ b/bin/v_delete_user_reports @@ -1,5 +1,10 @@ #!/bin/bash -# info: adding user reports +# info: delete user reports +# options: user +# +# The script for disabling reports on cron tasks and administrative +# notifications. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_get_user_value b/bin/v_get_user_value index 5b5062a8f..8bc3e5925 100755 --- a/bin/v_get_user_value +++ b/bin/v_get_user_value @@ -1,5 +1,9 @@ #!/bin/bash -# info: Getting system user value +# info: get user value +# options: user key +# +# The function for obtaining certain user's parameters. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_list_user b/bin/v_list_user index 9a1ea0296..89567e3c9 100755 --- a/bin/v_list_user +++ b/bin/v_list_user @@ -1,5 +1,9 @@ #!/bin/bash -# info: listing system user +# info: list system user +# options: user [format] +# +# The function for obtainig the list of all user's parameters. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_list_user_backups b/bin/v_list_user_backups index 2d5c091d4..79e703d08 100755 --- a/bin/v_list_user_backups +++ b/bin/v_list_user_backups @@ -1,5 +1,9 @@ #!/bin/bash -# info: listing system bakups +# info: list user backups +# options: user [format] +# +# The function for obtainig the list of available user backups. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_list_user_ips b/bin/v_list_user_ips index c4428effc..f93949332 100755 --- a/bin/v_list_user_ips +++ b/bin/v_list_user_ips @@ -1,5 +1,9 @@ #!/bin/bash -# info: listing user ips +# info: list user ips +# options user [format] +# +# The function for obtainig the list of available ip addresses. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_list_user_ns b/bin/v_list_user_ns index a313d91d2..a567ff7fc 100755 --- a/bin/v_list_user_ns +++ b/bin/v_list_user_ns @@ -1,5 +1,9 @@ #!/bin/bash -# info: listing user nameservers +# info: list user nameservers +# options: user [format] +# +# Function for obtainig the list of user's DNS servers. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_list_user_packages b/bin/v_list_user_packages index 2941a3839..af7b2f675 100755 --- a/bin/v_list_user_packages +++ b/bin/v_list_user_packages @@ -1,5 +1,9 @@ #!/bin/bash -# info: listing sys user packages +# info: list user packages +# options: [format] +# +# The function for obtaining the list of available hosting packages. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_list_users b/bin/v_list_users index 56b46bb74..d990b2ddb 100755 --- a/bin/v_list_users +++ b/bin/v_list_users @@ -1,5 +1,9 @@ #!/bin/bash -# info: listing system users +# info: list system users +# options: [format] +# +# The function for obtainig the list of all server's users. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_suspend_user b/bin/v_suspend_user index 841f37d2b..475de314f 100755 --- a/bin/v_suspend_user +++ b/bin/v_suspend_user @@ -1,5 +1,9 @@ #!/bin/bash -# info: Suspending sys user +# info: suspend user +# options: user +# +# The function suspends a certain user and all his objects. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_unsuspend_user b/bin/v_unsuspend_user index 8ee936bb0..a37aee177 100755 --- a/bin/v_unsuspend_user +++ b/bin/v_unsuspend_user @@ -1,5 +1,9 @@ #!/bin/bash -# info: Unsuspending sys user +# info: unsuspend user +# options: user +# +# The function unsuspends user and all his objects. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_user_backups b/bin/v_update_user_backups index 6b2da7b93..b725947bc 100755 --- a/bin/v_update_user_backups +++ b/bin/v_update_user_backups @@ -1,5 +1,9 @@ #!/bin/bash -# info: updating current backups for +# info: update user backups +# options: user +# +# The function rescan backup directory and updates backup database. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_user_bill b/bin/v_update_user_bill index 55d468e65..1f3978099 100755 --- a/bin/v_update_user_bill +++ b/bin/v_update_user_bill @@ -1,5 +1,9 @@ #!/bin/bash -# info: updating montly billing user report +# info: update billing user billing +# options: user +# +# Function logs user parameters into billing database. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_update_user_disk b/bin/v_update_user_disk index 2c9c64581..b3e612879 100755 --- a/bin/v_update_user_disk +++ b/bin/v_update_user_disk @@ -1,5 +1,9 @@ #!/bin/bash -# info: updating disk usage for user directories +# info: update user disk usage +# options: user +# +# The functions recalculates disk usage and updates database. + #----------------------------------------------------------# # Variable&Function #