|
@@ -0,0 +1,48 @@
|
|
|
|
|
+#!/bin/bash
|
|
|
|
|
+# info: restore single mail domain
|
|
|
|
|
+# options: USER BACKUP DOMAIN [NOTIFY]
|
|
|
|
|
+# labels: panel
|
|
|
|
|
+#
|
|
|
|
|
+# example: v-restore-web-domain USER BACKUP DOMAIN [NOTIFY]
|
|
|
|
|
+#
|
|
|
|
|
+# The function allows the user to restore a single mail domain
|
|
|
|
|
+# from a backup archive.
|
|
|
|
|
+
|
|
|
|
|
+#----------------------------------------------------------#
|
|
|
|
|
+# Variable&Function #
|
|
|
|
|
+#----------------------------------------------------------#
|
|
|
|
|
+
|
|
|
|
|
+# Argument definition
|
|
|
|
|
+user=$1
|
|
|
|
|
+backup=$2
|
|
|
|
|
+domain=$3
|
|
|
|
|
+notify=$4
|
|
|
|
|
+
|
|
|
|
|
+# Includes
|
|
|
|
|
+source $HESTIA/func/main.sh
|
|
|
|
|
+source $HESTIA/conf/hestia.conf
|
|
|
|
|
+
|
|
|
|
|
+# Perform verification if read-only mode is enabled
|
|
|
|
|
+check_hestia_demo_mode
|
|
|
|
|
+
|
|
|
|
|
+#----------------------------------------------------------#
|
|
|
|
|
+# Verifications #
|
|
|
|
|
+#----------------------------------------------------------#
|
|
|
|
|
+
|
|
|
|
|
+args_usage='USER BACKUP DOMAIN [NOTIFY]'
|
|
|
|
|
+check_args '3' "$#" "$args_usage"
|
|
|
|
|
+is_format_valid 'user' 'backup'
|
|
|
|
|
+
|
|
|
|
|
+#----------------------------------------------------------#
|
|
|
|
|
+# Action #
|
|
|
|
|
+#----------------------------------------------------------#
|
|
|
|
|
+
|
|
|
|
|
+$BIN/v-restore-user $user $backup 'no' 'no' $domain 'no' 'no' 'no' $notify
|
|
|
|
|
+
|
|
|
|
|
+#----------------------------------------------------------#
|
|
|
|
|
+# Hestia #
|
|
|
|
|
+#----------------------------------------------------------#
|
|
|
|
|
+
|
|
|
|
|
+log_event "$OK" "$ARGUMENTS"
|
|
|
|
|
+
|
|
|
|
|
+exit
|