1
0
mirror of https://github.com/myvesta/vesta.git synced 2025-03-12 04:35:23 -07:00

Code refactoring: domain_idn + new restart routine

This commit is contained in:
Serghey Rodin 2017-01-11 16:52:11 +02:00
parent b98abaf572
commit e5950d516d
104 changed files with 605 additions and 588 deletions
bin
v-add-dns-domainv-add-dns-recordv-add-domainv-add-mail-accountv-add-mail-account-aliasv-add-mail-account-autoreplyv-add-mail-account-forwardv-add-mail-account-fwd-onlyv-add-mail-domainv-add-mail-domain-antispamv-add-mail-domain-antivirusv-add-mail-domain-catchallv-add-mail-domain-dkimv-add-web-domainv-add-web-domain-aliasv-add-web-domain-backendv-add-web-domain-ftpv-add-web-domain-proxyv-add-web-domain-sslv-add-web-domain-statsv-backup-userv-change-dns-domain-expv-change-dns-domain-ipv-change-dns-domain-soav-change-dns-domain-tplv-change-dns-domain-ttlv-change-dns-recordv-change-dns-record-idv-change-mail-account-passwordv-change-mail-account-quotav-change-mail-domain-catchallv-change-sys-ip-natv-change-web-domain-backend-tplv-change-web-domain-ftp-passwordv-change-web-domain-ftp-pathv-change-web-domain-ipv-change-web-domain-namev-change-web-domain-proxy-tplv-change-web-domain-sslcertv-change-web-domain-sslhomev-change-web-domain-statsv-change-web-domain-tplv-delete-dns-domainv-delete-dns-domainsv-delete-dns-domains-srcv-delete-dns-on-web-aliasv-delete-dns-recordv-delete-domainv-delete-mail-accountv-delete-mail-account-aliasv-delete-mail-account-autoreplyv-delete-mail-account-forwardv-delete-mail-account-fwd-onlyv-delete-mail-domainv-delete-mail-domain-antispamv-delete-mail-domain-antivirusv-delete-mail-domain-catchallv-delete-web-domainv-delete-web-domain-aliasv-delete-web-domain-backendv-delete-web-domain-ftpv-delete-web-domain-proxyv-delete-web-domain-sslv-delete-web-domain-statsv-delete-web-domainsv-get-dns-domain-valuev-get-mail-account-valuev-get-mail-domain-valuev-insert-dns-domainv-insert-dns-recordv-insert-dns-recordsv-rebuild-cron-jobsv-rebuild-dns-domainv-rebuild-dns-domainsv-rebuild-web-domainsv-suspend-cron-jobv-suspend-cron-jobsv-suspend-dns-domainv-suspend-dns-recordv-suspend-domainv-suspend-mail-accountv-suspend-mail-accountsv-suspend-mail-domainv-suspend-userv-suspend-web-domainv-suspend-web-domainsv-unsuspend-cron-jobv-unsuspend-cron-jobsv-unsuspend-dns-domainv-unsuspend-dns-recordv-unsuspend-domainv-unsuspend-mail-accountv-unsuspend-mail-accountsv-unsuspend-mail-domainv-unsuspend-userv-unsuspend-web-domainv-unsuspend-web-domainsv-update-mail-domain-diskv-update-web-domain-diskv-update-web-domain-ssl

@ -15,15 +15,8 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | sed -e 's/\.*$//g' -e 's/^\.*//g')
if [[ "$domain" =~ [[:upper:]] ]]; then
domain=$(echo "$domain" |tr '[:upper:]' '[:lower:]')
fi
domain_idn="$domain"
if [[ "$domain" = *[![:ascii:]]* ]]; then
domain_idn=$(idn -t --quiet -a $domain)
fi
domain=$2
domain_idn=$2
ip=$3
ns1=$4
ns2=$5
@ -40,6 +33,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -56,37 +53,35 @@ template=$(get_user_value '$DNS_TEMPLATE')
is_dns_template_valid $template
if [ ! -z "$ns1" ]; then
ns1=$(echo $4 | sed -e 's/\.*$//g' -e 's/^\.*//g')
ns1=$(echo $4 |sed -e 's/\.*$//g' -e 's/^\.*//g')
is_format_valid 'ns1'
fi
if [ ! -z "$ns2" ]; then
ns2=$(echo $5 | sed -e 's/\.*$//g' -e 's/^\.*//g')
ns2=$(echo $5 |sed -e 's/\.*$//g' -e 's/^\.*//g')
is_format_valid 'ns2'
fi
if [ ! -z "$ns3" ]; then
ns3=$(echo $6 | sed -e 's/\.*$//g' -e 's/^\.*//g')
ns3=$(echo $6 |sed -e 's/\.*$//g' -e 's/^\.*//g')
is_format_valid 'ns3'
fi
if [ ! -z "$ns4" ]; then
ns4=$(echo $7 | sed -e 's/\.*$//g' -e 's/^\.*//g')
ns4=$(echo $7 |sed -e 's/\.*$//g' -e 's/^\.*//g')
is_format_valid 'ns4'
fi
if [ ! -z "$ns5" ]; then
ns5=$(echo $8 | sed -e 's/\.*$//g' -e 's/^\.*//g')
ns5=$(echo $8 |sed -e 's/\.*$//g' -e 's/^\.*//g')
is_format_valid 'ns5'
fi
if [ ! -z "$ns6" ]; then
ns6=$(echo $9 | sed -e 's/\.*$//g' -e 's/^\.*//g')
ns6=$(echo $9 |sed -e 's/\.*$//g' -e 's/^\.*//g')
is_format_valid 'ns6'
fi
if [ ! -z "$ns7" ]; then
ns7=$(echo ${10} | sed -e 's/\.*$//g' -e 's/^\.*//g')
ns7=$(echo ${10} |sed -e 's/\.*$//g' -e 's/^\.*//g')
is_format_valid 'ns7'
fi
if [ ! -z "$ns8" ]; then
ns8=$(echo ${11} | sed -e 's/\.*$//g' -e 's/^\.*//g')
ns8=$(echo ${11} |sed -e 's/\.*$//g' -e 's/^\.*//g')
is_format_valid 'ns8'
fi
@ -203,10 +198,8 @@ increase_user_value "$user" '$U_DNS_DOMAINS'
increase_user_value "$user" '$U_DNS_RECORDS' "$records"
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? "DNS restart failed"
fi
$BIN/v-restart-dns $restart
check_result $? "DNS restart failed"
# Logging
log_history "added dns domain $domain"

@ -26,11 +26,6 @@ if [ -z "$priority" ]; then
priority=10
fi
domain_idn="$domain"
if [[ "$domain" = *[![:ascii:]]* ]]; then
domain_idn=$(idn -t --quiet -a $domain)
fi
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
@ -55,6 +50,10 @@ if [[ "$dvalue" =~ [\;[:space:]] ]]; then
dvalue='"'"$dvalue"'"'
fi
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -121,10 +120,8 @@ update_object_value 'dns' 'DOMAIN' "$domain" '$RECORDS' "$records"
increase_user_value "$user" '$U_DNS_RECORDS'
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? $E_RESTART 'dns failed to restart'
fi
$BIN/v-restart-dns $restart
check_result $? $E_RESTART 'dns failed to restart'
# Logging
log_history "added $rtype dns record $record for $domain"

@ -64,16 +64,14 @@ if [ ! -z "$MAIL_SYSTEM" ]; then
fi
# Restarting services
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "can't restart web" > /dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "can't restart proxy" > /dev/null
fi
$BIN/v-restart-dns
check_result $? "can't restart dns" > /dev/null
fi
$BIN/v-restart-web $restart
check_result $? "can't restart web" > /dev/null
$BIN/v-restart-proxy $restart
check_result $? "can't restart proxy" > /dev/null
$BIN/v-restart-dns $restart
check_result $? "can't restart dns" > /dev/null
#----------------------------------------------------------#

@ -11,10 +11,8 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
account=$(echo $3 | tr '[:upper:]' '[:lower:]')
domain=$2
account=$3
password=$4; HIDE=4
quota=${5-unlimited}
@ -23,6 +21,11 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
if [[ "$account" =~ [[:upper:]] ]]; then
account=$(echo "$account" |tr '[:upper:]' '[:lower:]')
fi
#----------------------------------------------------------#
# Verifications #

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
malias=$4
@ -22,6 +20,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
autoreply=$4
@ -29,6 +27,10 @@ else
MAIL_USER=exim
fi
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
forward=$4
@ -22,6 +20,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
# Includes
@ -28,6 +26,10 @@ else
MAIL_USER=exim
fi
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,15 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | sed -e 's/\.*$//g' -e 's/^\.*//g')
if [[ "$domain" =~ [[:upper:]] ]]; then
domain=$(echo "$domain" |tr '[:upper:]' '[:lower:]')
fi
domain_idn="$domain"
if [[ "$domain" = *[![:ascii:]]* ]]; then
domain_idn=$(idn -t --quiet -a $domain)
fi
domain=$2
antispam=${3-yes}
antivirus=${4-yes}
dkim=${5-yes}
@ -37,6 +29,10 @@ else
MAIL_USER=exim
fi
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,15 +11,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,15 +11,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
email="$3"
# Includes
@ -21,6 +19,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
dkim_size=${3-1024}
# Includes
@ -28,6 +26,10 @@ else
MAIL_USER=exim
fi
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -18,37 +18,23 @@
# Argument definition
user=$1
domain=$2
domain_idn=$2
ip=$3
restart=$4 # will be moved to the end soon
aliases=$5
proxy_ext=$6
# Additional argument formatting
if [[ "$domain" =~ [[:upper:]] ]]; then
domain=$(echo "$domain" |tr '[:upper:]' '[:lower:]')
fi
if [[ "$domain" =~ ^www\..* ]]; then
domain=$(echo "$domain" |sed -e "s/^www.//")
fi
if [[ "$domain" =~ .*\.$ ]]; then
domain=$(echo "$domain" |sed -e "s/\.$//")
fi
domain_idn="$domain"
if [[ "$domain" = *[![:ascii:]]* ]]; then
domain_idn=$(idn -t --quiet -a $domain)
fi
if [ ! -z "$aliases" ] && [ "$aliases" != 'none' ]; then
aliases=$(echo $aliases |tr '[:upper:]' '[:lower:]' |tr ',' '\n')
aliases=$(echo "$aliases" |sed -e "s/\.$//" |sort -u |grep -v www.$domain)
aliases=$(echo "$aliases" |sed -e "/^$/d" |tr '\n' ',' |sed -e "s/,$//")
fi
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/func/ip.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
format_aliases
#----------------------------------------------------------#
# Verifications #
@ -178,10 +164,8 @@ $BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
# Restarting proxy server
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_history "added web domain $domain"

@ -12,13 +12,8 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
dom_alias=$(idn -t --quiet -u "$3" )
dom_alias=$(echo $dom_alias | sed -e 's/\.*$//g' -e 's/^\.*//g')
dom_alias=$(echo $dom_alias | tr '[:upper:]' '[:lower:]')
dom_alias_idn=$(idn -t --quiet -a "$dom_alias" )
domain=$2
aliases=$3
restart="$4"
# Includes
@ -27,6 +22,11 @@ source $VESTA/func/domain.sh
source $VESTA/func/ip.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
format_aliases
#----------------------------------------------------------#
# Verifications #
@ -39,7 +39,7 @@ is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"
is_object_unsuspended 'web' 'DOMAIN' "$domain"
is_domain_new 'web' "$dom_alias"
is_domain_new 'web' "$aliases"
is_package_full 'WEB_ALIASES'
@ -53,9 +53,9 @@ get_domain_values 'web'
# Preparing domain values for the template substitution
local_ip=$(get_real_ip $IP)
if [ -z "$ALIAS" ]; then
ALIAS="$dom_alias"
ALIAS="$aliases"
else
ALIAS="$ALIAS,$dom_alias"
ALIAS="$ALIAS,$aliases"
fi
prepare_web_domain_values
@ -87,17 +87,15 @@ update_object_value 'web' 'DOMAIN' "$domain" '$ALIAS' "$ALIAS"
increase_user_value "$user" '$U_WEB_ALIASES'
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
# Restarting proxy server
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
log_history "added $dom_alias as alias for $domain"
log_history "added $aliases for $domain"
log_event "$OK" "$ARGUMENTS"
exit

@ -67,10 +67,8 @@ cat $WEBTPL/$WEB_BACKEND/$template.tpl |\
#----------------------------------------------------------#
# Restart backend server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web-backend
check_result $? "Web backend restart failed" >/dev/null
fi
$BIN/v-restart-web-backend $restart
check_result $? "Web backend restart failed" >/dev/null
# Logging
log_history "added $WEB_BACKEND backend configuration for $domain"

@ -11,8 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
ftp_user=${1}_${3}
password=$4; HIDE=4
ftp_path=$5
@ -22,6 +21,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -72,10 +72,8 @@ update_object_value 'web' 'DOMAIN' "$domain" '$PROXY' "$template"
update_object_value 'web' 'DOMAIN' "$domain" '$PROXY_EXT' "$extentions"
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
log_history "enabled proxy support for $domain"
log_event "$OK" "$ARGUMENTS"

@ -16,8 +16,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
ssl_dir=$3
ssl_home=${4-same}
restart="$5"
@ -28,6 +27,10 @@ source $VESTA/func/domain.sh
source $VESTA/func/ip.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -97,15 +100,11 @@ update_object_value 'web' 'DOMAIN' "$domain" '$SSL_HOME' "$SSL_HOME"
update_object_value 'web' 'DOMAIN' "$domain" '$SSL' "yes"
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_history "enabled ssl support for $domain"

@ -15,8 +15,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
type=$3
# Includes
@ -24,6 +23,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -137,7 +137,7 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
mkdir -p $tmpdir/web/$domain/vesta
# Get domain variables
domain_idn=$(idn -t --quiet -a "$domain")
format_domain_idn
get_domain_values 'web'
# Backup web.conf
@ -286,7 +286,7 @@ if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL" != '*' ]; then
echo -e "$(date "+%F %T") $domain" |tee -a $BACKUP/$user.log
mkdir -p $tmpdir/mail/$domain/conf
mkdir -p $tmpdir/mail/$domain/vesta
domain_idn=$(idn -t --quiet -a "$domain")
format_domain_idn
# Backup exim config
if [[ "$MAIL_SYSTEM" =~ exim ]]; then

@ -12,14 +12,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
exp=$3
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,8 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
ip=$3
restart=$4
@ -21,6 +20,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -71,10 +74,8 @@ fi
#----------------------------------------------------------#
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? "DNS restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "DNS restart failed" >/dev/null
# Logging
log_history "changed dns ip for $domain to $ip"

@ -12,8 +12,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
soa=$(echo $3 | sed -e 's/\.*$//g' -e 's/^\.*//g')
restart=$4
@ -22,6 +21,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -65,10 +68,8 @@ fi
#----------------------------------------------------------#
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? "DNS restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "DNS restart failed" >/dev/null
# Logging
log_history "changed soa record for $domain to $soa"

@ -13,20 +13,19 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$2
template=$3
restart=$4
domain_idn="$domain"
if [[ "$domain" = *[![:ascii:]]* ]]; then
domain_idn=$(idn -t --quiet -a $domain)
fi
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -121,10 +120,8 @@ update_object_value 'dns' 'DOMAIN' "$domain" '$TPL' "$template"
update_object_value 'dns' 'DOMAIN' "$domain" '$RECORDS' "$records"
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? "DNS restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "DNS restart failed" >/dev/null
# Logging
log_history "changed dns template for $domain to $template" '' 'admin'

@ -11,8 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
ttl=$3
restart=$4
@ -21,6 +20,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -64,10 +67,8 @@ fi
#----------------------------------------------------------#
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? "DNS restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "DNS restart failed" >/dev/null
# Logging
log_history "changed TTL for $domain to $ttl"

@ -11,22 +11,21 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$2
id=$3
dvalue=$(idn -t --quiet -u "$4" )
priority=$5
restart=$6
domain_idn="$domain"
if [[ "$domain" = *[![:ascii:]]* ]]; then
domain_idn=$(idn -t --quiet -a $domain)
fi
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -105,10 +104,8 @@ fi
#----------------------------------------------------------#
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? "DNS restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "DNS restart failed" >/dev/null
# Logging
log_history "changed dns record on $domain to $dvalue"

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
id=$3
newid=$4
restart=$5
@ -23,6 +21,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -71,10 +73,8 @@ fi
#----------------------------------------------------------#
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? "DNS restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "DNS restart failed" >/dev/null
# Logging
log_history "changed dns record id on $domain"

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
password=$4; HIDE=4
@ -22,6 +20,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
quota=$4
@ -22,6 +20,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,16 +11,18 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
email="$3"
domain=$2
email=$3
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -53,7 +55,6 @@ fi
# Change catchall in config
update_object_value 'mail' 'DOMAIN' "$domain" '$CATCHALL' "$email"
# Logging
log_history "changed catchall email for $domain to $email"
log_event "$OK" "$ARGUMENTS"

@ -73,10 +73,8 @@ fi
#----------------------------------------------------------#
# Restart ftp server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-ftp
check_result $? "FTP restart failed" >/dev/null
fi
$BIN/v-restart-ftp $restart
check_result $? "FTP restart failed" >/dev/null
# Logging
log_history "changed associated nat address on $ip to $nat_ip" '' 'admin'

@ -11,11 +11,9 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
template=$3
restart="$4"
restart=$4
# Includes
source $VESTA/func/main.sh
@ -23,6 +21,10 @@ source $VESTA/func/domain.sh
source $VESTA/func/ip.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -143,13 +145,11 @@ fi
# Restarting web
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web-backend
check_result $? "Web backend restart failed" >/dev/null
fi
$BIN/v-restart-web-backend $restart
check_result $? "Web backend restart failed" >/dev/null
# Logging
log_history "changed backend template for $domain to $template"

@ -11,8 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
ftp_user=$3
password=$4; HIDE=4
@ -21,6 +20,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,8 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
ftp_user=$3
ftp_path=$4
@ -21,6 +20,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -21,6 +21,10 @@ source $VESTA/func/domain.sh
source $VESTA/func/ip.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -44,12 +48,6 @@ is_ip_valid "$ip" "$user"
get_domain_values 'web'
old=$(get_real_ip $IP)
new=$ip
if [[ "$domain" = *[![:ascii:]]* ]]; then
domain_idn=$(idn -t --quiet -a $domain)
else
domain_idn=$domain
fi
# Replacing vhost
replace_web_config "$WEB_SYSTEM" "$TPL.tpl"
@ -78,15 +76,11 @@ decrease_ip_value "$old"
update_object_value 'web' 'DOMAIN' "$domain" '$IP' "$3"
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "WEB restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "WEB restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_history "changed web domain $domain ip to $3"

@ -15,17 +15,16 @@ domain=$2
new_domain=$3
restart=$4
domain_idn="$domain"
if [[ "$domain" = *[![:ascii:]]* ]]; then
domain_idn=$(idn -t --quiet -a $domain)
fi
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/func/ip.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,21 +11,23 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
template=$3
default_extentions="jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,\
exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,html,htm"
extentions=${4-$default_extentions}
restart="$5"
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/func/ip.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -75,10 +77,8 @@ update_object_value 'web' 'DOMAIN' "$domain" '$PROXY' "$PROXY"
update_object_value 'web' 'DOMAIN' "$domain" '$PROXY_EXT' "$extentions"
# Restarting proxy
if [ "$restart" != 'no' ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_history "changed proxy template for $domain to $template"

@ -12,8 +12,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
ssl_dir=$3
restart=$4
@ -22,6 +21,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -71,15 +74,11 @@ fi
#----------------------------------------------------------#
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_history "changed ssl certificate for $domain"

@ -7,8 +7,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
ssl_home=$3
restart=$4
@ -17,6 +16,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -67,15 +70,11 @@ fi
update_object_value 'web' 'DOMAIN' "$domain" '$SSL_HOME' "$SSL_HOME"
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_history "changed ssl home for $domain to $ssl_home"

@ -12,8 +12,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
type=$3
# Includes
@ -21,6 +20,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -12,8 +12,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
template=$3
restart=$4
@ -23,6 +22,10 @@ source $VESTA/func/domain.sh
source $VESTA/func/ip.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -68,10 +71,8 @@ fi
update_object_value 'web' 'DOMAIN' "$domain" '$TPL' "$template"
# Restarting web
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
fi
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
# Logging
log_history "changed web domain template for $domain to $template" '' 'admin'

@ -72,10 +72,8 @@ decrease_user_value "$user" '$U_DNS_DOMAINS'
decrease_user_value "$user" '$U_DNS_RECORDS' "$records"
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns $restart
check_result $? "Bind restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "Bind restart failed" >/dev/null
# Logging
log_history "deleted dns domain $domain"

@ -43,10 +43,8 @@ done
#----------------------------------------------------------#
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? "Bind restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "Bind restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -44,10 +44,8 @@ done
#----------------------------------------------------------#
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? "Bind restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "Bind restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -11,11 +11,10 @@
# Argument definition
user=$1
domain=$(echo $2 | sed -e 's/\.*$//g' -e 's/^\.*//g')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
dom_alias=$(idn -t --quiet -u "$3" )
dom_alias=$(echo $dom_alias | sed -e 's/\.*$//g' -e 's/^\.*//g')
dom_alias=$(echo $dom_alias | tr '[:upper:]' '[:lower:]')
dom_alias=$(echo $dom_alias |sed -e 's/\.*$//g' -e 's/^\.*//g')
dom_alias=$(echo $dom_alias |tr '[:upper:]' '[:lower:]')
dom_alias_idn=$(idn -t --quiet -a "$dom_alias" )
restart="$4"
@ -24,6 +23,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -63,7 +66,7 @@ else
fi
if [ ! -z "$rec" ]; then
eval "$rec"
$BIN/v-delete-dns-record $user "$root" "$ID"
$BIN/v-delete-dns-record $user "$root" "$ID" $restart
fi
fi
fi

@ -11,8 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
id=$3
restart=$4
@ -21,6 +20,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -70,10 +73,8 @@ update_object_value 'dns' 'DOMAIN' "$domain" '$RECORDS' "$records"
decrease_user_value "$user" '$U_DNS_RECORDS'
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? "Bind restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "Bind restart failed" >/dev/null
# Logging
log_history "deleted dns record $id on $domain"

@ -69,16 +69,14 @@ if [ -z "$domain_found" ]; then
fi
# Restarting services
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "can't restart web" > /dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "can't restart proxy" > /dev/null
fi
$BIN/v-restart-dns
check_result $? "can't restart dns" > /dev/null
fi
$BIN/v-restart-web $restart
check_result $? "can't restart web" > /dev/null
$BIN/v-restart-proxy $restart
check_result $? "can't restart proxy" > /dev/null
$BIN/v-restart-dns $restart
check_result $? "can't restart dns" > /dev/null
#----------------------------------------------------------#

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
# Includes
@ -21,6 +19,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
malias=$4
@ -22,6 +20,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
malias=$4
@ -22,6 +20,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
forward=$4
@ -22,6 +20,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -38,9 +40,7 @@ is_object_valid "mail/$domain" 'ACCOUNT' "$account"
is_object_unsuspended "mail/$domain" 'ACCOUNT' "$account"
fwd=$(get_object_value "mail/$domain" 'ACCOUNT' "$account" '$FWD')
if [ -z "$(echo $fwd | grep -w $forward)" ]; then
echo "Error: forward $forward doesn't exist"
log_event "$E_NOTEXIST $ARGUMENTS"
exit $E_NOTEXIST
check_result $E_NOTEXIST "forward $forward doesn't exist"
fi

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
# Includes
@ -21,6 +19,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -12,14 +12,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,15 +11,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,15 +11,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,15 +11,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -23,6 +23,10 @@ source $VESTA/func/domain.sh
source $VESTA/func/ip.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -48,10 +52,6 @@ fi
# Parsing domain values
get_domain_values 'web'
domain_idn="$domain"
if [[ "$domain" = *[![:ascii:]]* ]]; then
domain_idn=$(idn -t --quiet -a $domain)
fi
local_ip=$(get_real_ip $IP)
# Deleting domain from web.conf
@ -121,16 +121,12 @@ if [ ! -z "$ALIAS" ]; then
fi
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
# Restartinh proxy server
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
# Restartinh proxy server
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_history "deleted web domain $domain"

@ -81,15 +81,11 @@ update_object_value 'web' 'DOMAIN' "$domain" '$ALIAS' "$ALIAS"
decrease_user_value "$user" '$U_WEB_ALIASES'
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_history "deleted alias $dom_alias on $domain"

@ -11,14 +11,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -66,10 +69,8 @@ rm -f $pool/$backend_type.conf
#----------------------------------------------------------#
# Restarting backend server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web-backend
check_result $? "Backend restart failed" >/dev/null
fi
$BIN/v-restart-web-backend $restart
check_result $? "Backend restart failed" >/dev/null
# Logging
log_history "deleting backend support for $domain"

@ -11,8 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
ftp_user=$3
# Includes
@ -20,6 +19,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,8 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
restart=$3
# Includes
@ -20,6 +19,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -58,10 +61,8 @@ update_object_value 'web' 'DOMAIN' "$domain" '$PROXY' ''
update_object_value 'web' 'DOMAIN' "$domain" '$PROXY_EXT' ''
# Restart proxy server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_history "disabled proxy support for $domain"

@ -11,8 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
restart=$3
# Includes
@ -20,6 +19,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -71,15 +74,11 @@ update_object_value 'web' 'DOMAIN' "$domain" '$SSL' 'no'
decrease_user_value "$user" '$U_WEB_SSL'
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_history "disabled ssl support for $domain"

@ -12,14 +12,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -43,15 +43,11 @@ done
#----------------------------------------------------------#
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -11,13 +11,16 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
key=$(echo "$3"| tr '[:lower:]' '[:upper:]' | sed "s/^/$/")
# Includes
source $VESTA/func/main.sh
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,14 +11,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
key=$(echo "$4"| tr '[:lower:]' '[:upper:]' | sed "s/^/$/")
# Includes
source $VESTA/func/main.sh
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,13 +11,16 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
key=$(echo "$3"| tr '[:lower:]' '[:upper:]' | sed "s/^/$/")
# Includes
source $VESTA/func/main.sh
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -74,10 +74,8 @@ chmod 660 $USER_DATA/dns.conf
#----------------------------------------------------------#
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns $restart
check_result $? "Bind restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "Bind restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -45,10 +45,8 @@ echo "$data" >> $USER_DATA/dns/$domain.conf
#----------------------------------------------------------#
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns $restart
check_result $? "Bind restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "Bind restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -48,10 +48,8 @@ fi
#----------------------------------------------------------#
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? "Bind restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "Bind restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -41,10 +41,8 @@ sync_cron_jobs
#----------------------------------------------------------#
# Restarting crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
check_result $? "Cron restart failed" >/dev/null
fi
$BIN/v-restart-cron $restart
check_result $? "Cron restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -82,10 +82,8 @@ update_user_value "$user" '$U_DNS_RECORDS' "$user_records"
update_user_value "$user" '$SUSPENDED_DNS' "$suspended_dns"
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns "$restart"
check_result $? "Bind restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "Bind restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -83,10 +83,8 @@ update_user_value "$user" '$U_DNS_RECORDS' "$user_records"
update_user_value "$user" '$SUSPENDED_DNS' "$suspended_dns"
# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? "Bind restart failed" >/dev/null
fi
$BIN/v-restart-dns $restart
check_result $? "Bind restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -75,15 +75,11 @@ done
$BIN/v-update-user-counters $user
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -47,10 +47,8 @@ sync_cron_jobs
#----------------------------------------------------------#
# Restarting crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
check_result $? "Cron restart failed" >/dev/null
fi
$BIN/v-restart-cron $restart
check_result $? "Cron restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -42,10 +42,8 @@ done
#----------------------------------------------------------#
# Restarting crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
check_result $? "Cron restart failed" >/dev/null
fi
$BIN/v-restart-cron $restart
check_result $? "Cron restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -11,14 +11,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
restart="$3"
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,20 +11,19 @@
# Argument definition
user=$1
domain="$2"
domain=$2
id=$3
restart="$4"
domain_idn="$domain"
if [[ "$domain" = *[![:ascii:]]* ]]; then
domain_idn=$(idn -t --quiet -a $domain)
fi
restart=$4
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -71,16 +71,14 @@ if [ -z "$domain_found" ]; then
fi
# Restarting services
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "can't restart web" > /dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "can't restart proxy" > /dev/null
fi
$BIN/v-restart-dns
check_result $? "can't restart dns" > /dev/null
fi
$BIN/v-restart-web $restat
check_result $? "can't restart web" > /dev/null
$BIN/v-restart-proxy $restart
check_result $? "can't restart proxy" > /dev/null
$BIN/v-restart-dns $restart
check_result $? "can't restart dns" > /dev/null
#----------------------------------------------------------#

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
# Includes
@ -21,6 +19,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,14 +11,15 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
#----------------------------------------------------------#
# Verifications #

@ -11,15 +11,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -74,16 +74,14 @@ fi
#----------------------------------------------------------#
# Restarting system services
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-dns
check_result $? "DNS restart failed" >/dev/null
$BIN/v-restart-dns $restart
check_result $? "DNS restart failed" >/dev/null
$BIN/v-restart-cron
check_result $? "Cron restart failed" >/dev/null
fi
$BIN/v-restart-cron $restart
check_result $? "Cron restart failed" >/dev/null
# Changing suspend value
update_user_value "$user" '$SUSPENDED' 'yes'

@ -13,8 +13,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
restart=$3
# Includes
@ -23,6 +22,10 @@ source $VESTA/func/domain.sh
source $VESTA/func/ip.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -76,15 +79,11 @@ update_object_value 'web' 'DOMAIN' "$domain" '$SUSPENDED' 'yes'
increase_user_value "$user" '$SUSPENDED_WEB'
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -43,15 +43,11 @@ done
#----------------------------------------------------------#
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -47,10 +47,8 @@ sync_cron_jobs
#----------------------------------------------------------#
# Restarting crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
check_result $? "Cron restart failed" >/dev/null
fi
$BIN/v-restart-cron $restart
check_result $? "Cron restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -42,10 +42,8 @@ done
#----------------------------------------------------------#
# Restarting crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
check_result $? "Cron restart failed" >/dev/null
fi
$BIN/v-restart-cron $restart
check_result $? "Cron restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -11,14 +11,16 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
restart="$3"
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -13,18 +13,17 @@
user=$1
domain=$2
id=$3
restart="$4"
domain_idn="$domain"
if [[ "$domain" = *[![:ascii:]]* ]]; then
domain_idn=$(idn -t --quiet -a $domain)
fi
restart=$4
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -70,16 +70,14 @@ if [ -z "$domain_found" ]; then
fi
# Restarting services
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "can't restart web" > /dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "can't restart proxy" > /dev/null
fi
$BIN/v-restart-dns
check_result $? "can't restart dns" > /dev/null
fi
$BIN/v-restart-web $restart
check_result $? "can't restart web" > /dev/null
$BIN/v-restart-proxy $restart
check_result $? "can't restart proxy" > /dev/null
$BIN/v-restart-dns $restart
check_result $? "can't restart dns" > /dev/null
#----------------------------------------------------------#

@ -11,9 +11,7 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
account=$3
# Includes
@ -21,6 +19,10 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,14 +11,16 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,15 +11,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -77,16 +77,14 @@ update_user_value "$user" '$SUSPENDED' 'no'
decrease_user_value 'admin' '$SUSPENDED_USERS'
# Restarting system services
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-dns
check_result $? "DNS restart failed" >/dev/null
$BIN/v-restart-dns $restart
check_result $? "DNS restart failed" >/dev/null
$BIN/v-restart-cron
check_result $? "Cron restart failed" >/dev/null
fi
$BIN/v-restart-cron $restart
check_result $? "Cron restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -11,9 +11,8 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
restart="$3"
domain=$2
restart=$3
# Includes
source $VESTA/func/main.sh
@ -21,6 +20,10 @@ source $VESTA/func/domain.sh
source $VESTA/func/ip.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -74,15 +77,11 @@ update_object_value 'web' 'DOMAIN' "$domain" '$SUSPENDED' 'no'
decrease_user_value "$user" '$SUSPENDED_WEB'
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -44,15 +44,11 @@ done
#----------------------------------------------------------#
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_event "$OK" "$ARGUMENTS"

@ -11,14 +11,16 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -11,14 +11,17 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #

@ -14,10 +14,9 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
domain=$2
ssl_dir=$3
restart="$4"
restart=$4
# Includes
source $VESTA/func/main.sh
@ -25,6 +24,10 @@ source $VESTA/func/domain.sh
source $VESTA/func/ip.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -74,15 +77,11 @@ fi
#----------------------------------------------------------#
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Logging
log_history "update ssl certificate for $domain"

Some files were not shown because too many files have changed in this diff Show More