From 86675e091987dc7ffb049aa86f701a45c5191fd2 Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Sat, 28 Nov 2009 20:47:14 -0500 Subject: netcfg.action: save static profiles in array Signed-off-by: Jim Pryor --- ifplugd/netcfg.action | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ifplugd') 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 ;; -- cgit v1.2.3-24-g4f1b