diff options
-rwxr-xr-x | ifplugd/netcfg.action | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ifplugd/netcfg.action b/ifplugd/netcfg.action index 7bcebd8..25942d1 100755 --- a/ifplugd/netcfg.action +++ b/ifplugd/netcfg.action @@ -13,21 +13,20 @@ case "$2" in # dhcp can actually outright fail, whereas # it's difficult to tell if static succeeded # Also check profile is same iface and is right connection + declare -a static_profiles for profile in $(list_profiles); do ( load_profile "$profile" [[ "$INTERFACE" != "$1" ]] && continue [[ "$CONNECTION" != @(ethernet|ethernet-iproute) ]] && continue if [[ "$IP" == "dhcp" ]]; then netcfg "$profile" && exit 0 + else + static_profiles+=("$profile") fi ) done - for profile in $(list_profiles}; do ( + for profile in "${static_profiles[@]}"; do ( load_profile "$profile" - [[ "$INTERFACE" != "$1" ]] && continue - [[ "$CONNECTION" != @(ethernet|ethernet-iproute) ]] && continue - if [[ "$IP" == "static" ]]; then - netcfg "$profile" && exit 0 - fi + netcfg "$profile" && exit 0 ) done exit 1 ;; |