renamed cert to ssl

This commit is contained in:
Serghey Rodin 2011-11-22 13:52:55 +02:00
commit 8022c261f4
8 changed files with 17 additions and 17 deletions

View file

@ -103,7 +103,7 @@ touch $V_USERS/$user/user.conf
echo "v_upd_sys_user_disk $user" >> $V_QUEUE/disk.pipe echo "v_upd_sys_user_disk $user" >> $V_QUEUE/disk.pipe
if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then
mkdir $V_USERS/$user/cert mkdir $V_USERS/$user/ssl
touch $V_USERS/$user/web.conf touch $V_USERS/$user/web.conf
echo "$V_BIN/v_upd_web_domains_traff $user" >> $V_QUEUE/traffic.pipe echo "$V_BIN/v_upd_web_domains_traff $user" >> $V_QUEUE/traffic.pipe
echo "v_upd_web_domains_disk $user" >> $V_QUEUE/disk.pipe echo "v_upd_web_domains_disk $user" >> $V_QUEUE/disk.pipe

View file

@ -13,14 +13,14 @@ ssl=$2
source $VESTA/conf/vars.conf source $VESTA/conf/vars.conf
source $V_CONF/vesta.conf source $V_CONF/vesta.conf
source $V_FUNC/shared.func source $V_FUNC/shared.func
source $V_FUNC/cert.func source $V_FUNC/ssl.func
#----------------------------------------------------------# #----------------------------------------------------------#
# Verifications # # Verifications #
#----------------------------------------------------------# #----------------------------------------------------------#
# Checking arg number # Checking arg number
check_args '2' "$#" 'user ssl_certificate' check_args '2' "$#" 'user ssl'
# Checking argument format # Checking argument format
format_validation 'user' 'ssl' format_validation 'user' 'ssl'
@ -43,8 +43,8 @@ is_cert_valid "$V_TMP"
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding certificate to user dir # Adding certificate to user dir
mv $V_TMP/$ssl.crt $V_USERS/$user/cert/ mv $V_TMP/$ssl.crt $V_USERS/$user/ssl/
mv $V_TMP/$ssl.key $V_USERS/$user/cert/ mv $V_TMP/$ssl.key $V_USERS/$user/ssl/
#----------------------------------------------------------# #----------------------------------------------------------#
@ -52,7 +52,7 @@ mv $V_TMP/$ssl.key $V_USERS/$user/cert/
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # 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" log_event 'system' "$V_EVENT"
exit exit

View file

@ -25,7 +25,7 @@ source $V_FUNC/ip.func
#----------------------------------------------------------# #----------------------------------------------------------#
# Checking arg number # Checking arg number
check_args '3' "$#" 'user domain certificate [sslhome]' check_args '3' "$#" 'user domain ssl [sslhome]'
# Checking argument format # Checking argument format
format_validation 'user' 'domain' 'ssl' format_validation 'user' 'domain' 'ssl'
@ -76,8 +76,8 @@ upd_web_domain_values
add_web_config add_web_config
# Adding certificate to user dir # Adding certificate to user dir
cp -f $V_USERS/$user/cert/$SSL.crt $ssl_cert cp -f $V_USERS/$user/ssl/$SSL.crt $ssl_cert
cp -f $V_USERS/$user/cert/$SSL.key $ssl_key cp -f $V_USERS/$user/ssl/$SSL.key $ssl_key
# Running template trigger # Running template trigger
if [ -x $V_WEBTPL/apache_$template.sh ]; then if [ -x $V_WEBTPL/apache_$template.sh ]; then

View file

@ -78,8 +78,8 @@ if [ ! -z "$NGINX" ]; then
fi fi
# Adding new certificate to user dir # Adding new certificate to user dir
cp -f $V_USERS/$user/cert/$SSL.crt $ssl_cert cp -f $V_USERS/$user/ssl/$SSL.crt $ssl_cert
cp -f $V_USERS/$user/cert/$SSL.key $ssl_key cp -f $V_USERS/$user/ssl/$SSL.key $ssl_key
# Deleting old certificate # Deleting old certificate
check_cert=$(grep "SSL='$old_ssl'" $V_USERS/$user/web.conf |wc -l) check_cert=$(grep "SSL='$old_ssl'" $V_USERS/$user/web.conf |wc -l)

View file

@ -13,7 +13,7 @@ ssl=$2
source $VESTA/conf/vars.conf source $VESTA/conf/vars.conf
source $V_CONF/vesta.conf source $V_CONF/vesta.conf
source $V_FUNC/shared.func source $V_FUNC/shared.func
source $V_FUNC/cert.func source $V_FUNC/ssl.func
#----------------------------------------------------------# #----------------------------------------------------------#
@ -41,7 +41,7 @@ is_cert_used
#----------------------------------------------------------# #----------------------------------------------------------#
# Deleting certificate # Deleting certificate
rm -f $V_USERS/$user/cert/$ssl.* rm -f $V_USERS/$user/ssl/$ssl.*
#----------------------------------------------------------# #----------------------------------------------------------#

View file

@ -19,7 +19,7 @@ json_list_cert() {
echo '[' echo '['
# Checking certificates number # 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) certificates_count=$(echo "$certificates" | wc -l)
i=1 i=1
@ -46,7 +46,7 @@ shell_list_cert() {
fi fi
# Listing files by mask # 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 # Print result
echo "${cert//.crt/}" echo "${cert//.crt/}"
done done

View file

@ -449,7 +449,7 @@ is_web_domain_key_empty() {
is_web_domain_cert_valid() { is_web_domain_cert_valid() {
# Checking file existance # Checking file existance
path="$V_USERS/$user/cert" path="$V_USERS/$user/ssl"
if [ ! -e "$path/$ssl.crt" ] || [ ! -e "$path/$ssl.key" ]; then if [ ! -e "$path/$ssl.crt" ] || [ ! -e "$path/$ssl.key" ]; then
echo "Error: certificate not exist" echo "Error: certificate not exist"
log_event 'debug' "$E_CERT_NOTEXIST $V_EVENT" log_event 'debug' "$E_CERT_NOTEXIST $V_EVENT"

View file

@ -1,6 +1,6 @@
is_cert_free() { is_cert_free() {
# Defining path # Defining path
user_cert="$V_USERS/$user/cert/$cert" user_cert="$V_USERS/$user/ssl/$cert"
# Checking file existance # Checking file existance
if [ -e "$user_cert.crt" ] || [ -e "$user_cert.key" ]; then if [ -e "$user_cert.crt" ] || [ -e "$user_cert.key" ]; then