From 7436cde4a3b074458b93d35ca2811675fccc45c8 Mon Sep 17 00:00:00 2001 From: Kory Prince Date: Wed, 8 May 2013 15:16:26 -0500 Subject: Added netctl-auto detection --- src/wifi-menu | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/wifi-menu b/src/wifi-menu index 188f6c7..5a9184e 100755 --- a/src/wifi-menu +++ b/src/wifi-menu @@ -143,11 +143,18 @@ connect_to_ssid() PROFILE=$(create_profile "$1") RETURN=$? (( RETURN == 0 )) || return $RETURN - SPAWNED_PROFILE=1 + NEW_PROFILE=1 fi clear - if ! netctl switch-to "$PROFILE"; then - if (( SPAWNED_PROFILE )); then + if systemctl is-active --quiet "netctl-auto@$INTERFACE.service"; then + if (( NEW_PROFILE )); then + systemctl restart netctl-auto@$INTERFACE.service + echo 'Profile created. Restarting netctl-auto service.' + else + echo 'Profile already created.' + fi + elif ! netctl switch-to "$PROFILE"; then + if (( NEW_PROFILE )); then msg=" CONNECTING FAILED Do you want to keep the generated profile ('$PROFILE')?" -- cgit v1.2.3-24-g4f1b