From b67632d5784ace2ec5add0c334d687af35b5aa36 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 24 Jun 2016 18:04:16 +0300 Subject: [PATCH] check_result() refactoring --- bin/v-change-sys-ip-status | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/bin/v-change-sys-ip-status b/bin/v-change-sys-ip-status index ef48af7b7..7f834065f 100755 --- a/bin/v-change-sys-ip-status +++ b/bin/v-change-sys-ip-status @@ -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