Skip to content

Commit b737d39

Browse files
author
Kristan Kenney
committed
Add v-rebuild-mail-domain-ssl
Recreates the SSL configuration for a mail domain
1 parent 3404fe8 commit b737d39

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

bin/v-rebuild-mail-domain-ssl

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
# info: rebuild system user
3+
# options: USER [RESTART]
4+
#
5+
# The function rebuilds mail domain SSL configuration
6+
7+
8+
#----------------------------------------------------------#
9+
# Variable&Function #
10+
#----------------------------------------------------------#
11+
12+
# Argument definition
13+
user=$1
14+
domain=$2
15+
restart=$3
16+
17+
# Includes
18+
source $HESTIA/func/main.sh
19+
source $HESTIA/func/rebuild.sh
20+
source $HESTIA/conf/hestia.conf
21+
22+
# Export sbin
23+
export PATH=$PATH:/usr/sbin
24+
25+
26+
#----------------------------------------------------------#
27+
# Verifications #
28+
#----------------------------------------------------------#
29+
30+
check_args '2' "$#" 'USER DOMAIN [RESTART]'
31+
is_format_valid 'user' 'domain'
32+
33+
is_object_valid 'user' 'USER' "$user"
34+
is_object_unsuspended 'user' 'USER' "$user"
35+
is_object_valid 'user' 'DOMAIN' "$domain"
36+
is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
37+
38+
is_format_valid 'user' 'domain'
39+
40+
is_object_valid 'user' 'USER' "$user"
41+
is_object_unsuspended 'user' 'USER' "$user"
42+
is_object_valid 'dns' 'DOMAIN' "$domain"
43+
44+
45+
#----------------------------------------------------------#
46+
# Action #
47+
#----------------------------------------------------------#
48+
49+
# Rebuild SSL configuration
50+
del_mail_ssl_config
51+
add_mail_ssl_config
52+
53+
#----------------------------------------------------------#
54+
# Hestia #
55+
#----------------------------------------------------------#
56+
57+
# Logging
58+
log_event "$OK" "$ARGUMENTS"
59+
60+
exit

0 commit comments

Comments
 (0)