mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
refactoring: log_event(), is_format_valid()
This commit is contained in:
parent
6e0ef668bb
commit
e05dca61a6
211 changed files with 756 additions and 1091 deletions
|
@ -24,11 +24,11 @@ source $VESTA/conf/vesta.conf
|
|||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'IP IP_STATUS'
|
||||
validate_format 'ip' 'ip_status'
|
||||
is_format_valid '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"
|
||||
log_event "$E_EXISTS" "$ARGUMENTS"
|
||||
exit $E_EXISTS
|
||||
fi
|
||||
|
||||
|
@ -37,7 +37,7 @@ 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"
|
||||
log_event "$E_INUSE" "$ARGUMENTS"
|
||||
exit $E_INUSE
|
||||
fi
|
||||
|
||||
|
@ -56,6 +56,6 @@ update_ip_value '$STATUS' "$ip_status"
|
|||
|
||||
# Logging
|
||||
log_history "changed $ip status to $ip_status" '' 'admin'
|
||||
log_event "$OK" "$EVENT"
|
||||
log_event "$OK" "$ARGUMENTS"
|
||||
|
||||
exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue