mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
Added web tab triggers. Issue #50
This commit is contained in:
parent
745318e14e
commit
3a09991f0a
8 changed files with 30 additions and 4 deletions
|
@ -207,6 +207,7 @@ increase_ip_value "$ip"
|
||||||
|
|
||||||
# Increasing domain value
|
# Increasing domain value
|
||||||
increase_user_value "$user" '$U_WEB_DOMAINS'
|
increase_user_value "$user" '$U_WEB_DOMAINS'
|
||||||
|
increase_user_value "$user" '$U_WEB_ALIASES'
|
||||||
|
|
||||||
# Defining domain variables
|
# Defining domain variables
|
||||||
v_str="DOMAIN='$domain'"
|
v_str="DOMAIN='$domain'"
|
||||||
|
|
|
@ -120,6 +120,9 @@ fi
|
||||||
# Adding new alias
|
# Adding new alias
|
||||||
update_web_domain_value '$ALIAS' "$ALIAS"
|
update_web_domain_value '$ALIAS' "$ALIAS"
|
||||||
|
|
||||||
|
# Update counters
|
||||||
|
increase_user_value "$user" '$U_WEB_ALIASES'
|
||||||
|
|
||||||
# Adding task to the vesta pipe
|
# Adding task to the vesta pipe
|
||||||
restart_schedule 'web'
|
restart_schedule 'web'
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,13 @@ conf="$V_HOME/$user/conf/web/httpd.conf"
|
||||||
# Deleting domain
|
# Deleting domain
|
||||||
del_web_config
|
del_web_config
|
||||||
|
|
||||||
|
# Checking aliases
|
||||||
|
if [ ! -z "$ALIAS" ]; then
|
||||||
|
aliases=$(echo $ALIAS | tr ',' '\n' | wc -l )
|
||||||
|
else
|
||||||
|
aliases=0
|
||||||
|
fi
|
||||||
|
|
||||||
# Checking ssl
|
# Checking ssl
|
||||||
if [ "$SSL" = 'yes' ]; then
|
if [ "$SSL" = 'yes' ]; then
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
|
@ -152,6 +159,14 @@ decrease_ip_value "$IP"
|
||||||
# Decreasing domain value
|
# Decreasing domain value
|
||||||
decrease_user_value "$user" '$U_WEB_DOMAINS'
|
decrease_user_value "$user" '$U_WEB_DOMAINS'
|
||||||
|
|
||||||
|
# Decreasing web aliases
|
||||||
|
decrease_user_value "$user" '$U_WEB_ALIASES' "$aliases"
|
||||||
|
|
||||||
|
# Decreasing web ssl
|
||||||
|
if [ "$SSL" = 'yes' ]; then
|
||||||
|
decrease_user_value "$user" '$U_WEB_SSL'
|
||||||
|
fi
|
||||||
|
|
||||||
# Adding task to the vesta pipe
|
# Adding task to the vesta pipe
|
||||||
restart_schedule 'web'
|
restart_schedule 'web'
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,9 @@ fi
|
||||||
# Deleting alias
|
# Deleting alias
|
||||||
update_web_domain_value '$ALIAS' "$ALIAS"
|
update_web_domain_value '$ALIAS' "$ALIAS"
|
||||||
|
|
||||||
|
# Update counters
|
||||||
|
decrease_user_value "$user" '$U_WEB_ALIASES'
|
||||||
|
|
||||||
# Adding task to the vesta pipe
|
# Adding task to the vesta pipe
|
||||||
restart_schedule 'web'
|
restart_schedule 'web'
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ fields="\$DOMAIN \$ALIAS"
|
||||||
case $format in
|
case $format in
|
||||||
json) json_list ;;
|
json) json_list ;;
|
||||||
plain) nohead=1; shell_list ;;
|
plain) nohead=1; shell_list ;;
|
||||||
shell) shell_list | column -t ;;
|
shell) shell_list;;
|
||||||
*) check_args '1' '0' 'user [format]'
|
*) check_args '1' '0' 'user [format]'
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -97,6 +97,7 @@ fi
|
||||||
|
|
||||||
# Adding suspend in config
|
# Adding suspend in config
|
||||||
update_web_domain_value '$SUSPENDED' 'yes'
|
update_web_domain_value '$SUSPENDED' 'yes'
|
||||||
|
increase_user_value "$user" '$SUSPENDED_WEB'
|
||||||
|
|
||||||
# Adding task to the vesta pipe
|
# Adding task to the vesta pipe
|
||||||
restart_schedule 'web'
|
restart_schedule 'web'
|
||||||
|
|
|
@ -90,8 +90,9 @@ fi
|
||||||
# Vesta #
|
# Vesta #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Adding suspend in config
|
# Updating suspend keys
|
||||||
update_web_domain_value '$SUSPENDED' 'no'
|
update_web_domain_value '$SUSPENDED' 'no'
|
||||||
|
decrease_user_value "$user" '$SUSPENDED_WEB'
|
||||||
|
|
||||||
# Adding task to the vesta pipe
|
# Adding task to the vesta pipe
|
||||||
restart_schedule 'web'
|
restart_schedule 'web'
|
||||||
|
|
|
@ -692,6 +692,7 @@ update_user_value() {
|
||||||
increase_user_value() {
|
increase_user_value() {
|
||||||
USER="$1"
|
USER="$1"
|
||||||
key="${2//$}"
|
key="${2//$}"
|
||||||
|
factor="${3-1}"
|
||||||
|
|
||||||
# Parsing current value
|
# Parsing current value
|
||||||
conf="$V_USERS/$USER/user.conf"
|
conf="$V_USERS/$USER/user.conf"
|
||||||
|
@ -701,7 +702,7 @@ increase_user_value() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increasing
|
# Increasing
|
||||||
new=$((old + 1 ))
|
new=$((old + factor))
|
||||||
sed -i "s/$key='$old'/$key='$new'/g" $conf
|
sed -i "s/$key='$old'/$key='$new'/g" $conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -731,6 +732,7 @@ is_type_valid() {
|
||||||
decrease_user_value() {
|
decrease_user_value() {
|
||||||
USER="$1"
|
USER="$1"
|
||||||
key="${2//$}"
|
key="${2//$}"
|
||||||
|
factor="${3-1}"
|
||||||
|
|
||||||
# Parsing current value
|
# Parsing current value
|
||||||
conf="$V_USERS/$USER/user.conf"
|
conf="$V_USERS/$USER/user.conf"
|
||||||
|
@ -743,7 +745,7 @@ decrease_user_value() {
|
||||||
if [ "$old" -le 1 ]; then
|
if [ "$old" -le 1 ]; then
|
||||||
new=0
|
new=0
|
||||||
else
|
else
|
||||||
new=$((old - 1 ))
|
new=$((old - factor))
|
||||||
fi
|
fi
|
||||||
sed -i "s/$key='$old'/$key='$new'/g" $conf
|
sed -i "s/$key='$old'/$key='$new'/g" $conf
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue