summaryrefslogtreecommitdiffstats
path: root/src-wireless/net-auto
diff options
context:
space:
mode:
authorJames Rayner <james@archlinux.org>2009-02-16 11:09:06 +0100
committerJames Rayner <james@archlinux.org>2009-02-16 11:09:06 +0100
commit371cd06f36328ba0ddb75fe64102e8fc232a7fd3 (patch)
tree1584bb6d4eafe2cd2ee257d9c9b1d3ef1cc67a58 /src-wireless/net-auto
parentcfcf836b94c5f3b520f0022942b1932c566eefdb (diff)
downloadnetctl-371cd06f36328ba0ddb75fe64102e8fc232a7fd3.tar.gz
netctl-371cd06f36328ba0ddb75fe64102e8fc232a7fd3.tar.xz
various fixes, and new quirk 'noacheck'
Diffstat (limited to 'src-wireless/net-auto')
-rwxr-xr-xsrc-wireless/net-auto28
1 files changed, 13 insertions, 15 deletions
diff --git a/src-wireless/net-auto b/src-wireless/net-auto
index add6711..a4f68b2 100755
--- a/src-wireless/net-auto
+++ b/src-wireless/net-auto
@@ -14,23 +14,21 @@ case "$1" in
fi
done
- for network in ${AUTO_NETWORKS[@]}; do
- case $network in
- auto-*) # Automatic configuration, store type and get interface next
- auto=$network
- ;;
- *) # Either interface or profile
- if [[ "$auto" ]]; then # Auto set, so interface
- /usr/bin/netcfg-$auto $network
- unset auto
- fi
- esac
- done
-
- add_daemon net-auto
+ # TODO: check if any way of using 'stacks' in bash
+ for iface in ${AUTO_NETWORKS[@]}; do
+ if [[ "${iface:0:4}" = "auto" ]]; then
+ auto=$iface
+ elif [[ "$auto" ]]; then
+ /usr/bin/netcfg-$auto $iface
+ [[ $? -eq 0 ]] && echo $iface >> /var/run/daemons/net-auto
+ unset auto
+ fi
+ done
;;
stop)
- /usr/bin/netcfg2 -a
+ for iface in $(cat /var/run/daemons/net-auto); do
+ netcfg interface-down $iface
+ done
rm_daemon net-auto
;;
restart)