=== modified file 'zsh-functions/confz_ip_init' --- zsh-functions/confz_ip_init 2016-02-22 11:57:59 +0000 +++ zsh-functions/confz_ip_init 2016-02-22 11:51:54 +0000 @@ -9,16 +9,18 @@ checkvars name mac # local -A ifaces - local ignored iface mac rest out old_name + local ignored iface mac rest out ok old_name out=$( confz_do ip link show ) || die "ip failed" + ok=0 while read ignored iface rest; do read ignored mac rest if [[ ${iface%:} == $vars[name] ]]; then [[ $mac == $vars[mac] ]] || \ die "${(qqq)iface%:} already exists with different MAC address" - return 0 + ok=1 + break fi if [[ -z $old_name && $mac == $vars[mac] ]]; then old_name=${iface%:} @@ -28,5 +30,5 @@ [[ -n $old_name ]] || die "could not find interface with MAC: $vars[mac]" do_command=( ip link set dev $old_name name $vars[name] ) - return 1 + (($ok)) }