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