summaryrefslogtreecommitdiffstats
path: root/src/net-profiles
diff options
context:
space:
mode:
authorJames Rayner <james@archlinux.org>2010-01-31 00:03:29 +0100
committerJames Rayner <james@archlinux.org>2010-01-31 00:03:29 +0100
commitb6964c5f37deb1bd7a265268ba8abf59c01e7694 (patch)
tree82b73c0062f319ddec1198c09fb1532846525127 /src/net-profiles
parent359dc6d0679ecb00063099f8915cd1b43a127d0a (diff)
downloadnetctl-b6964c5f37deb1bd7a265268ba8abf59c01e7694.tar.gz
netctl-b6964c5f37deb1bd7a265268ba8abf59c01e7694.tar.xz
Fix FS#17406, FS#17307
Diffstat (limited to 'src/net-profiles')
-rw-r--r--src/net-profiles36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/net-profiles b/src/net-profiles
index ccb14ee..fe57762 100644
--- a/src/net-profiles
+++ b/src/net-profiles
@@ -32,32 +32,26 @@ case "$1" in
add_daemon net-profiles
exit 0
fi
+ elif [[ $NETWORKS = "menu" ]]; then
+ if /usr/bin/netcfg-menu "$NETWORKS_MENU_TIMEOUT"; then
+ mv "$STATE_DIR"/menu "$STATE_DIR"/net-profiles
+ add_daemon net-profiles
+ exit 0
+ fi
else
# No NET= passed at boot, go to NETWORKS=()
for network in "${NETWORKS[@]}"; do
- case "$network" in
- menu) # Pull up menu of networks
- if /usr/bin/netcfg-menu "$NETWORKS_MENU_TIMEOUT"; then
- mv "$STATE_DIR"/{menu,net-profiles} # JP: user may want to disconnect profile by calling net-profiles stop
- add_daemon net-profiles
- exit 0
- fi
- break # if netcfg-menu was called but failed: exit for loop
- ;;
- *) # Either interface or profile
- if [[ "$network" = "${network#!}" ]]; then # otherwise profile
- if /usr/bin/netcfg2 check-iface "$network"; then
- echo "$network" > "$STATE_DIR/net-profiles" # JP: user may want to disconnect profile by calling net-profiles stop
- add_daemon net-profiles
- exit 0
- fi
- fi
- ;;
- esac
+ if [[ "$network" = "${network#!}" ]]; then
+ if /usr/bin/netcfg2 check-iface "$network"; then
+ echo "$network" > "$STATE_DIR/net-profiles"
+ add_daemon net-profiles
+ fi
+ fi
done
fi
-
- exit_err "No profile started." # JP: don't add_daemon unless we were successful (above)
+ if [[ ! -f "$STATE_DIR"/net-profiles ]]; then
+ exit_err "No profile started." # JP: don't add_daemon unless we were successful (above)
+ fi
;;
stop)
if ck_daemon net-profiles; then