#!/bin/bash # info: restore single mail domain # options: USER BACKUP DOMAIN [NOTIFY] # # example: v-restore-mail-domain USER BACKUP DOMAIN [NOTIFY] # # This function allows the user to restore a single mail domain # from a backup archive. #----------------------------------------------------------# # Variables & Functions # #----------------------------------------------------------# # Argument definition user=$1 backup=$2 domain=$3 notify=$4 # Includes # shellcheck source=/etc/hestiacp/hestia.conf source /etc/hestiacp/hestia.conf # shellcheck source=/usr/local/hestia/func/main.sh source $HESTIA/func/main.sh # load config file source_conf "$HESTIA/conf/hestia.conf" #----------------------------------------------------------# # Verifications # #----------------------------------------------------------# args_usage='USER BACKUP DOMAIN [NOTIFY]' check_args '3' "$#" "$args_usage" is_format_valid 'user' 'backup' # Perform verification if read-only mode is enabled check_hestia_demo_mode #----------------------------------------------------------# # Action # #----------------------------------------------------------# $BIN/v-restore-user "$user" "$backup" 'no' 'no' "$domain" 'no' 'no' 'no' "$notify" #----------------------------------------------------------# # Hestia # #----------------------------------------------------------# log_event "$OK" "$ARGUMENTS" exit