Skip to content

Commit 8022c26

Browse files
committed
renamed cert to ssl
1 parent 30d1240 commit 8022c26

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

bin/v_add_sys_user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ touch $V_USERS/$user/user.conf
103103
echo "v_upd_sys_user_disk $user" >> $V_QUEUE/disk.pipe
104104

105105
if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then
106-
mkdir $V_USERS/$user/cert
106+
mkdir $V_USERS/$user/ssl
107107
touch $V_USERS/$user/web.conf
108108
echo "$V_BIN/v_upd_web_domains_traff $user" >> $V_QUEUE/traffic.pipe
109109
echo "v_upd_web_domains_disk $user" >> $V_QUEUE/disk.pipe
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ ssl=$2
1313
source $VESTA/conf/vars.conf
1414
source $V_CONF/vesta.conf
1515
source $V_FUNC/shared.func
16-
source $V_FUNC/cert.func
16+
source $V_FUNC/ssl.func
1717

1818
#----------------------------------------------------------#
1919
# Verifications #
2020
#----------------------------------------------------------#
2121

2222
# Checking arg number
23-
check_args '2' "$#" 'user ssl_certificate'
23+
check_args '2' "$#" 'user ssl'
2424

2525
# Checking argument format
2626
format_validation 'user' 'ssl'
@@ -43,16 +43,16 @@ is_cert_valid "$V_TMP"
4343
#----------------------------------------------------------#
4444

4545
# Adding certificate to user dir
46-
mv $V_TMP/$ssl.crt $V_USERS/$user/cert/
47-
mv $V_TMP/$ssl.key $V_USERS/$user/cert/
46+
mv $V_TMP/$ssl.crt $V_USERS/$user/ssl/
47+
mv $V_TMP/$ssl.key $V_USERS/$user/ssl/
4848

4949

5050
#----------------------------------------------------------#
5151
# Vesta #
5252
#----------------------------------------------------------#
5353

5454
# Logging
55-
log_history "$V_EVENT" "v_del_ssl_certificate $user $ssl"
55+
log_history "$V_EVENT" "v_del_sys_user_ssl $user $ssl"
5656
log_event 'system' "$V_EVENT"
5757

5858
exit

bin/v_add_web_domain_ssl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ source $V_FUNC/ip.func
2525
#----------------------------------------------------------#
2626

2727
# Checking arg number
28-
check_args '3' "$#" 'user domain certificate [sslhome]'
28+
check_args '3' "$#" 'user domain ssl [sslhome]'
2929

3030
# Checking argument format
3131
format_validation 'user' 'domain' 'ssl'
@@ -76,8 +76,8 @@ upd_web_domain_values
7676
add_web_config
7777

7878
# Adding certificate to user dir
79-
cp -f $V_USERS/$user/cert/$SSL.crt $ssl_cert
80-
cp -f $V_USERS/$user/cert/$SSL.key $ssl_key
79+
cp -f $V_USERS/$user/ssl/$SSL.crt $ssl_cert
80+
cp -f $V_USERS/$user/ssl/$SSL.key $ssl_key
8181

8282
# Running template trigger
8383
if [ -x $V_WEBTPL/apache_$template.sh ]; then

bin/v_change_web_domain_sslcert

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ if [ ! -z "$NGINX" ]; then
7878
fi
7979

8080
# Adding new certificate to user dir
81-
cp -f $V_USERS/$user/cert/$SSL.crt $ssl_cert
82-
cp -f $V_USERS/$user/cert/$SSL.key $ssl_key
81+
cp -f $V_USERS/$user/ssl/$SSL.crt $ssl_cert
82+
cp -f $V_USERS/$user/ssl/$SSL.key $ssl_key
8383

8484
# Deleting old certificate
8585
check_cert=$(grep "SSL='$old_ssl'" $V_USERS/$user/web.conf |wc -l)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ssl=$2
1313
source $VESTA/conf/vars.conf
1414
source $V_CONF/vesta.conf
1515
source $V_FUNC/shared.func
16-
source $V_FUNC/cert.func
16+
source $V_FUNC/ssl.func
1717

1818

1919
#----------------------------------------------------------#
@@ -41,7 +41,7 @@ is_cert_used
4141
#----------------------------------------------------------#
4242

4343
# Deleting certificate
44-
rm -f $V_USERS/$user/cert/$ssl.*
44+
rm -f $V_USERS/$user/ssl/$ssl.*
4545

4646

4747
#----------------------------------------------------------#
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ json_list_cert() {
1919
echo '['
2020

2121
# Checking certificates number
22-
certificates=$(ls $V_USERS/$user/cert/ |grep '.crt' )
22+
certificates=$(ls $V_USERS/$user/ssl/ |grep '.crt' )
2323
certificates_count=$(echo "$certificates" | wc -l)
2424
i=1
2525

@@ -46,7 +46,7 @@ shell_list_cert() {
4646
fi
4747

4848
# Listing files by mask
49-
for cert in $(ls $V_USERS/$user/cert/ | grep '.crt'); do
49+
for cert in $(ls $V_USERS/$user/ssl/ | grep '.crt'); do
5050
# Print result
5151
echo "${cert//.crt/}"
5252
done

func/domain.func

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ is_web_domain_key_empty() {
449449

450450
is_web_domain_cert_valid() {
451451
# Checking file existance
452-
path="$V_USERS/$user/cert"
452+
path="$V_USERS/$user/ssl"
453453
if [ ! -e "$path/$ssl.crt" ] || [ ! -e "$path/$ssl.key" ]; then
454454
echo "Error: certificate not exist"
455455
log_event 'debug' "$E_CERT_NOTEXIST $V_EVENT"

func/cert.func renamed to func/ssl.func

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
is_cert_free() {
22
# Defining path
3-
user_cert="$V_USERS/$user/cert/$cert"
3+
user_cert="$V_USERS/$user/ssl/$cert"
44

55
# Checking file existance
66
if [ -e "$user_cert.crt" ] || [ -e "$user_cert.key" ]; then

0 commit comments

Comments
 (0)