mirror of
https://github.com/myvesta/vesta
synced 2025-07-05 20:41:53 -07:00
check_result() refactoring
This commit is contained in:
parent
ebc53f6129
commit
b67632d578
1 changed files with 2 additions and 7 deletions
|
@ -27,18 +27,13 @@ check_args '2' "$#" 'IP IP_STATUS'
|
|||
is_format_valid 'ip' 'ip_status'
|
||||
is_ip_valid "$ip"
|
||||
if [ "$ip_status" = "$(get_ip_value '$STATUS')" ]; then
|
||||
echo "Error: status $ip_status is already set"
|
||||
log_event "$E_EXISTS" "$ARGUMENTS"
|
||||
exit $E_EXISTS
|
||||
check_result "$E_EXISTS" "status $ip_status is already set"
|
||||
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" "$ARGUMENTS"
|
||||
exit $E_INUSE
|
||||
check_result "$E_INUSE" "ip $ip is used"
|
||||
fi
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue