mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 13:24:25 -07:00
Update v-make-separated-ip-for-email
This commit is contained in:
parent
6ebf690d54
commit
812d92b5f3
1 changed files with 15 additions and 4 deletions
|
@ -5,10 +5,9 @@
|
|||
#
|
||||
# The function add new ip, add new host for mail, try to generate letsencrypt for it, and makes email to be sent via that IP only for SMTP authenticated users
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "USAGE: v-make-separate-ip-for-email MAIL_HOSTNAME MAIL_IP"
|
||||
exit 1
|
||||
fi
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
MAIL_HOSTNAME=$1
|
||||
MAIL_IP=$2
|
||||
|
@ -25,6 +24,14 @@ else
|
|||
INTERFACE='eth0'
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'MAIL_HOSTNAME MAIL_IP'
|
||||
is_domain_format_valid "$MAIL_HOSTNAME"
|
||||
is_ip_format_valid "$MAIL_IP"
|
||||
|
||||
HOST_USER=$($VESTA/bin/v-search-domain-owner "$HOSTNAME")
|
||||
if [ -z "$HOST_USER" ]; then
|
||||
echo "Error: hostname $HOSTNAME is not created as web domain"
|
||||
|
@ -44,6 +51,10 @@ if [ $# -gt 3 ]; then
|
|||
echo "INTERFACE : $INTERFACE"
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
if [ ! -f "/usr/local/vesta/data/ips/$MAIL_IP" ]; then
|
||||
$VESTA/bin/v-add-sys-ip "$MAIL_IP" "$NETMASK" "$INTERFACE" 'admin' 'dedicated' '' ''
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue