mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
Merge changes from upstream
I'm a little angry
This commit is contained in:
parent
dcf849263d
commit
2b16d9bd83
254 changed files with 24485 additions and 24094 deletions
|
@ -1,66 +1,66 @@
|
|||
#!/bin/bash
|
||||
# info: change user nameservers
|
||||
# options: user ns1 ns2 [ns3] [ns4]
|
||||
#
|
||||
# The function for changing default nameservers for speciefic user.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
ns1=$(echo $2 | sed -e 's/\.*$//g' -e 's/^\.*//g')
|
||||
ns2=$(echo $3 | sed -e 's/\.*$//g' -e 's/^\.*//g')
|
||||
ns3=$4
|
||||
ns4=$5
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Checking args
|
||||
check_args '3' "$#" 'user ns1 ns2 [ns3] [ns4]'
|
||||
|
||||
# Checking argument format
|
||||
validate_format 'user' 'ns1' 'ns2'
|
||||
if [ ! -z "$ns3" ]; then
|
||||
ns3=$(echo $4 | sed -e 's/\.*$//g' -e 's/^\.*//g')
|
||||
validate_format 'ns3'
|
||||
fi
|
||||
if [ ! -z "$ns4" ]; then
|
||||
ns4=$(echo $5 | sed -e 's/\.*$//g' -e 's/^\.*//g')
|
||||
validate_format 'ns4'
|
||||
fi
|
||||
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Merging values
|
||||
ns="$ns1,$ns2,$ns3,$ns4"
|
||||
ns=$(echo "$ns"|sed -e "s/,,//g" -e "s/,$//")
|
||||
|
||||
# Changing ns values
|
||||
update_user_value "$user" '$NS' "$ns"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_history "changed user nameservers to $ns1, $ns2"
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
||||
#!/bin/bash
|
||||
# info: change user nameservers
|
||||
# options: USER NS1 NS2 [NS3] [NS4]
|
||||
#
|
||||
# The function for changing default nameservers for speciefic user.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
ns1=$(echo $2 | sed -e 's/\.*$//g' -e 's/^\.*//g')
|
||||
ns2=$(echo $3 | sed -e 's/\.*$//g' -e 's/^\.*//g')
|
||||
ns3=$4
|
||||
ns4=$5
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Checking args
|
||||
check_args '3' "$#" 'USER NS1 NS2 [NS3] [NS4]'
|
||||
|
||||
# Checking argument format
|
||||
validate_format 'user' 'ns1' 'ns2'
|
||||
if [ ! -z "$ns3" ]; then
|
||||
ns3=$(echo $4 | sed -e 's/\.*$//g' -e 's/^\.*//g')
|
||||
validate_format 'ns3'
|
||||
fi
|
||||
if [ ! -z "$ns4" ]; then
|
||||
ns4=$(echo $5 | sed -e 's/\.*$//g' -e 's/^\.*//g')
|
||||
validate_format 'ns4'
|
||||
fi
|
||||
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Merging values
|
||||
ns="$ns1,$ns2,$ns3,$ns4"
|
||||
ns=$(echo "$ns"|sed -e "s/,,//g" -e "s/,$//")
|
||||
|
||||
# Changing ns values
|
||||
update_user_value "$user" '$NS' "$ns"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_history "changed user nameservers to $ns1, $ns2"
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue