Jelajahi Sumber

Added documentations for USER functions.

Serghey Rodin 14 tahun lalu
induk
melakukan
87fcc5d83b

+ 9 - 4
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
 
 

+ 5 - 1
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                     #

+ 6 - 1
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                     #

+ 4 - 0
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                     #

+ 6 - 3
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

+ 6 - 1
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                         #
 #----------------------------------------------------------#

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 6 - 1
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                     #

+ 5 - 1
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                     #

+ 6 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #

+ 5 - 1
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                     #