summaryrefslogtreecommitdiffstats
path: root/ifplugd
diff options
context:
space:
mode:
authorJim Pryor <profjim@jimpryor.net>2009-11-29 02:47:14 +0100
committerJames Rayner <james@archlinux.org>2009-12-03 21:28:31 +0100
commit86675e091987dc7ffb049aa86f701a45c5191fd2 (patch)
treebe5d3d2f1edab5f7a797c880f1bd4e99da34e5e6 /ifplugd
parentd2731ee9c21c6ecf86aa2df9b9b694cd758f1197 (diff)
downloadnetctl-86675e091987dc7ffb049aa86f701a45c5191fd2.tar.gz
netctl-86675e091987dc7ffb049aa86f701a45c5191fd2.tar.xz
netcfg.action: save static profiles in array
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Diffstat (limited to 'ifplugd')
-rwxr-xr-xifplugd/netcfg.action11
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
;;