Просмотр исходного кода

Add v-rebuild-mail-domain-ssl

Recreates the SSL configuration for a mail domain
Kristan Kenney 7 лет назад
Родитель
Сommit
b737d39013
1 измененных файлов с 60 добавлено и 0 удалено
  1. 60 0
      bin/v-rebuild-mail-domain-ssl

+ 60 - 0
bin/v-rebuild-mail-domain-ssl

@@ -0,0 +1,60 @@
+#!/bin/bash
+# info: rebuild system user
+# options: USER [RESTART]
+#
+# The function rebuilds mail domain SSL configuration
+
+
+#----------------------------------------------------------#
+#                    Variable&Function                     #
+#----------------------------------------------------------#
+
+# Argument definition
+user=$1
+domain=$2
+restart=$3
+
+# Includes
+source $HESTIA/func/main.sh
+source $HESTIA/func/rebuild.sh
+source $HESTIA/conf/hestia.conf
+
+# Export sbin
+export PATH=$PATH:/usr/sbin
+
+
+#----------------------------------------------------------#
+#                    Verifications                         #
+#----------------------------------------------------------#
+
+check_args '2' "$#" 'USER DOMAIN [RESTART]'
+is_format_valid 'user' 'domain'
+
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+is_object_valid 'user' 'DOMAIN' "$domain"
+is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
+
+is_format_valid 'user' 'domain'
+
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+is_object_valid 'dns' 'DOMAIN' "$domain"
+
+
+#----------------------------------------------------------#
+#                       Action                             #
+#----------------------------------------------------------#
+
+# Rebuild SSL configuration
+del_mail_ssl_config
+add_mail_ssl_config
+
+#----------------------------------------------------------#
+#                       Hestia                             #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit