Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requests passwords even for knowns connections #13

Open
g4rrucho opened this issue Aug 16, 2020 · 1 comment
Open

Requests passwords even for knowns connections #13

g4rrucho opened this issue Aug 16, 2020 · 1 comment

Comments

@g4rrucho
Copy link

For every known connections, the script still asks for the password.

I believe that this can be achieved with command "nmcli connection show"
Just an idea here.

@g4rrucho
Copy link
Author

g4rrucho commented Aug 17, 2020

    else
        if [[ "$OPS" =~ "WPA2" ]] || [[ "$OPS" =~ "WEP" ]]; then
          WIFIPASS=$(echo -en "" | rofi -dmenu -password -p "PASSWORD" \
            -mesg "Enter the PASSWORD of the network" -lines 0 -font "$FONT")
        fi

        if [ -z "$WIFIPASS" ]; then
          nmcli dev wifi con "$CHSSID"
        fi

        if [[ "$CHSSID" != '' ]] && [[ "$WIFIPASS" != '' ]]; then
          nmcli dev wifi con "$CHSSID" password "$WIFIPASS"
        fi
    fi

This else is the last from the main function btw.
Since the user knows which connection it's already saved, the password won't be entered.

Another way to do this could be with the 'nmcli connection show' command, if the user doesn't want to remember which connections he has saved, which makes more sense in my mind.

if [ -n $( nmcli connection show | grep "$CHSSID" ) ]; then
   nmcli dev wifi con "$CHSSID"
fi 

jonnieey added a commit to jonnieey/nmcli-rofi that referenced this issue Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant