From 8022c261f4224be759508c8f22fb254202fb35fa Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 22 Nov 2011 13:52:55 +0200 Subject: [PATCH] renamed cert to ssl --- bin/v_add_sys_user | 2 +- bin/{v_add_ssl_certificate => v_add_sys_user_ssl} | 10 +++++----- bin/v_add_web_domain_ssl | 6 +++--- bin/v_change_web_domain_sslcert | 4 ++-- bin/{v_del_ssl_certificate => v_del_sys_user_ssl} | 4 ++-- bin/{v_list_ssl_certificates => v_list_sys_user_ssl} | 4 ++-- func/domain.func | 2 +- func/{cert.func => ssl.func} | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) rename bin/{v_add_ssl_certificate => v_add_sys_user_ssl} (85%) rename bin/{v_del_ssl_certificate => v_del_sys_user_ssl} (95%) rename bin/{v_list_ssl_certificates => v_list_sys_user_ssl} (94%) rename func/{cert.func => ssl.func} (97%) diff --git a/bin/v_add_sys_user b/bin/v_add_sys_user index 3f8f6674..b4c62c0a 100755 --- a/bin/v_add_sys_user +++ b/bin/v_add_sys_user @@ -103,7 +103,7 @@ touch $V_USERS/$user/user.conf echo "v_upd_sys_user_disk $user" >> $V_QUEUE/disk.pipe if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then - mkdir $V_USERS/$user/cert + mkdir $V_USERS/$user/ssl touch $V_USERS/$user/web.conf echo "$V_BIN/v_upd_web_domains_traff $user" >> $V_QUEUE/traffic.pipe echo "v_upd_web_domains_disk $user" >> $V_QUEUE/disk.pipe diff --git a/bin/v_add_ssl_certificate b/bin/v_add_sys_user_ssl similarity index 85% rename from bin/v_add_ssl_certificate rename to bin/v_add_sys_user_ssl index 62c7ee3a..4d9d870f 100755 --- a/bin/v_add_ssl_certificate +++ b/bin/v_add_sys_user_ssl @@ -13,14 +13,14 @@ ssl=$2 source $VESTA/conf/vars.conf source $V_CONF/vesta.conf source $V_FUNC/shared.func -source $V_FUNC/cert.func +source $V_FUNC/ssl.func #----------------------------------------------------------# # Verifications # #----------------------------------------------------------# # Checking arg number -check_args '2' "$#" 'user ssl_certificate' +check_args '2' "$#" 'user ssl' # Checking argument format format_validation 'user' 'ssl' @@ -43,8 +43,8 @@ is_cert_valid "$V_TMP" #----------------------------------------------------------# # Adding certificate to user dir -mv $V_TMP/$ssl.crt $V_USERS/$user/cert/ -mv $V_TMP/$ssl.key $V_USERS/$user/cert/ +mv $V_TMP/$ssl.crt $V_USERS/$user/ssl/ +mv $V_TMP/$ssl.key $V_USERS/$user/ssl/ #----------------------------------------------------------# @@ -52,7 +52,7 @@ mv $V_TMP/$ssl.key $V_USERS/$user/cert/ #----------------------------------------------------------# # Logging -log_history "$V_EVENT" "v_del_ssl_certificate $user $ssl" +log_history "$V_EVENT" "v_del_sys_user_ssl $user $ssl" log_event 'system' "$V_EVENT" exit diff --git a/bin/v_add_web_domain_ssl b/bin/v_add_web_domain_ssl index 9c8ada95..95ae3157 100755 --- a/bin/v_add_web_domain_ssl +++ b/bin/v_add_web_domain_ssl @@ -25,7 +25,7 @@ source $V_FUNC/ip.func #----------------------------------------------------------# # Checking arg number -check_args '3' "$#" 'user domain certificate [sslhome]' +check_args '3' "$#" 'user domain ssl [sslhome]' # Checking argument format format_validation 'user' 'domain' 'ssl' @@ -76,8 +76,8 @@ upd_web_domain_values add_web_config # Adding certificate to user dir -cp -f $V_USERS/$user/cert/$SSL.crt $ssl_cert -cp -f $V_USERS/$user/cert/$SSL.key $ssl_key +cp -f $V_USERS/$user/ssl/$SSL.crt $ssl_cert +cp -f $V_USERS/$user/ssl/$SSL.key $ssl_key # Running template trigger if [ -x $V_WEBTPL/apache_$template.sh ]; then diff --git a/bin/v_change_web_domain_sslcert b/bin/v_change_web_domain_sslcert index 0ed000b9..1bedc9ce 100755 --- a/bin/v_change_web_domain_sslcert +++ b/bin/v_change_web_domain_sslcert @@ -78,8 +78,8 @@ if [ ! -z "$NGINX" ]; then fi # Adding new certificate to user dir -cp -f $V_USERS/$user/cert/$SSL.crt $ssl_cert -cp -f $V_USERS/$user/cert/$SSL.key $ssl_key +cp -f $V_USERS/$user/ssl/$SSL.crt $ssl_cert +cp -f $V_USERS/$user/ssl/$SSL.key $ssl_key # Deleting old certificate check_cert=$(grep "SSL='$old_ssl'" $V_USERS/$user/web.conf |wc -l) diff --git a/bin/v_del_ssl_certificate b/bin/v_del_sys_user_ssl similarity index 95% rename from bin/v_del_ssl_certificate rename to bin/v_del_sys_user_ssl index 1c20bc4c..4d91deae 100755 --- a/bin/v_del_ssl_certificate +++ b/bin/v_del_sys_user_ssl @@ -13,7 +13,7 @@ ssl=$2 source $VESTA/conf/vars.conf source $V_CONF/vesta.conf source $V_FUNC/shared.func -source $V_FUNC/cert.func +source $V_FUNC/ssl.func #----------------------------------------------------------# @@ -41,7 +41,7 @@ is_cert_used #----------------------------------------------------------# # Deleting certificate -rm -f $V_USERS/$user/cert/$ssl.* +rm -f $V_USERS/$user/ssl/$ssl.* #----------------------------------------------------------# diff --git a/bin/v_list_ssl_certificates b/bin/v_list_sys_user_ssl similarity index 94% rename from bin/v_list_ssl_certificates rename to bin/v_list_sys_user_ssl index a850842a..16d1e7fa 100755 --- a/bin/v_list_ssl_certificates +++ b/bin/v_list_sys_user_ssl @@ -19,7 +19,7 @@ json_list_cert() { echo '[' # Checking certificates number - certificates=$(ls $V_USERS/$user/cert/ |grep '.crt' ) + certificates=$(ls $V_USERS/$user/ssl/ |grep '.crt' ) certificates_count=$(echo "$certificates" | wc -l) i=1 @@ -46,7 +46,7 @@ shell_list_cert() { fi # Listing files by mask - for cert in $(ls $V_USERS/$user/cert/ | grep '.crt'); do + for cert in $(ls $V_USERS/$user/ssl/ | grep '.crt'); do # Print result echo "${cert//.crt/}" done diff --git a/func/domain.func b/func/domain.func index 422a6818..75edd0d7 100644 --- a/func/domain.func +++ b/func/domain.func @@ -449,7 +449,7 @@ is_web_domain_key_empty() { is_web_domain_cert_valid() { # Checking file existance - path="$V_USERS/$user/cert" + path="$V_USERS/$user/ssl" if [ ! -e "$path/$ssl.crt" ] || [ ! -e "$path/$ssl.key" ]; then echo "Error: certificate not exist" log_event 'debug' "$E_CERT_NOTEXIST $V_EVENT" diff --git a/func/cert.func b/func/ssl.func similarity index 97% rename from func/cert.func rename to func/ssl.func index a0bd9e8a..2ec06a90 100644 --- a/func/cert.func +++ b/func/ssl.func @@ -1,6 +1,6 @@ is_cert_free() { # Defining path - user_cert="$V_USERS/$user/cert/$cert" + user_cert="$V_USERS/$user/ssl/$cert" # Checking file existance if [ -e "$user_cert.crt" ] || [ -e "$user_cert.key" ]; then