commit 1826234e7cc00ed0e16d5cf9bca74b3ba06ac6a8 parent 7222c1e0a2171bc457b9049e64b7e59f850e38e2 Author: Jan Pobrislo <ccx@webprojekty.cz> Date: Mon, 22 Feb 2016 12:51:54 +0100 Fixes for interface renaming. Diffstat:
| M | zsh-functions/confz_ip_init | | | 6 | +++--- |
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/zsh-functions/confz_ip_init b/zsh-functions/confz_ip_init @@ -18,16 +18,16 @@ confz_rename_interface_check() { read ignored mac rest if [[ ${iface%:} == $vars[name] ]]; then [[ $mac == $vars[mac] ]] || \ - "${(qqq)iface%:} already exists with different MAC address" + die "${(qqq)iface%:} already exists with different MAC address" ok=1 break fi - if ! (($+old_name)) && [[ $mac == $vars[mac] ]]; then + if [[ -z $old_name && $mac == $vars[mac] ]]; then old_name=${iface%:} fi done <<<$out - (($+old_name)) || die "could not find interface with MAC: $vars[mac]" + [[ -n $old_name ]] || die "could not find interface with MAC: $vars[mac]" do_command=( ip link set dev $old_name name $vars[name] ) (($ok))