summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKory Prince <korylprince@gmail.com>2013-05-08 22:16:26 +0200
committerKory Prince <korylprince@gmail.com>2013-05-11 22:22:58 +0200
commit7436cde4a3b074458b93d35ca2811675fccc45c8 (patch)
tree55cf3b4e7d69216b14fb93b37e4bba4270c6792e /src
parent711c46457ae9fef52c7c529d89c67d0d526f73ef (diff)
downloadnetctl-7436cde4a3b074458b93d35ca2811675fccc45c8.tar.gz
netctl-7436cde4a3b074458b93d35ca2811675fccc45c8.tar.xz
Added netctl-auto detection
Diffstat (limited to 'src')
-rwxr-xr-xsrc/wifi-menu13
1 files changed, 10 insertions, 3 deletions
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')?"