mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
dox2unix fix after merge
This commit is contained in:
parent
6e0aba66e0
commit
b8b28120fd
231 changed files with 20776 additions and 20776 deletions
|
@ -1,60 +1,60 @@
|
|||
#!/bin/bash
|
||||
# info: change ip status
|
||||
# options: IP IP_STATUS
|
||||
#
|
||||
# The function of changing an ip address's status.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
ip=$1
|
||||
ip_status=$2
|
||||
|
||||
# Includes
|
||||
source $VESTA/func/main.sh
|
||||
source $VESTA/func/ip.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'IP IP_STATUS'
|
||||
validate_format 'ip' 'ip_status'
|
||||
is_ip_valid
|
||||
if [ "$ip_status" = "$(get_ip_value '$STATUS')" ]; then
|
||||
echo "Error: status $ip_status is already set"
|
||||
log_event "$E_EXISTS" "$EVENT"
|
||||
exit $E_EXISTS
|
||||
fi
|
||||
|
||||
web_domains=$(get_ip_value '$U_WEB_DOMAINS')
|
||||
sys_user=$(get_ip_value '$U_SYS_USERS')
|
||||
ip_owner=$(get_ip_value '$OWNER')
|
||||
if [ "$web_domains" -ne '0' ] && [ "$sys_user" != "$ip_owner" ]; then
|
||||
echo "Error: ip $ip is used"
|
||||
log_event "$E_INUSE" "$EVENT"
|
||||
exit $E_INUSE
|
||||
fi
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Changing ip name
|
||||
update_ip_value '$STATUS' "$ip_status"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_history "changed $ip status to $ip_status" '' 'admin'
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
||||
#!/bin/bash
|
||||
# info: change ip status
|
||||
# options: IP IP_STATUS
|
||||
#
|
||||
# The function of changing an ip address's status.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
ip=$1
|
||||
ip_status=$2
|
||||
|
||||
# Includes
|
||||
source $VESTA/func/main.sh
|
||||
source $VESTA/func/ip.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'IP IP_STATUS'
|
||||
validate_format 'ip' 'ip_status'
|
||||
is_ip_valid
|
||||
if [ "$ip_status" = "$(get_ip_value '$STATUS')" ]; then
|
||||
echo "Error: status $ip_status is already set"
|
||||
log_event "$E_EXISTS" "$EVENT"
|
||||
exit $E_EXISTS
|
||||
fi
|
||||
|
||||
web_domains=$(get_ip_value '$U_WEB_DOMAINS')
|
||||
sys_user=$(get_ip_value '$U_SYS_USERS')
|
||||
ip_owner=$(get_ip_value '$OWNER')
|
||||
if [ "$web_domains" -ne '0' ] && [ "$sys_user" != "$ip_owner" ]; then
|
||||
echo "Error: ip $ip is used"
|
||||
log_event "$E_INUSE" "$EVENT"
|
||||
exit $E_INUSE
|
||||
fi
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Changing ip name
|
||||
update_ip_value '$STATUS' "$ip_status"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_history "changed $ip status to $ip_status" '' 'admin'
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue