LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-18-2019, 03:41 PM   #16
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware 14.2 current / ArcoLinux / Void Linux
Posts: 8,864

Rep: Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851

I have not seen what you got, but was thinking if you're getting more than one net you can put into your wpa file, me I'd try to figure it out how to put all of that information into maybe an array and in a loop so I can select one, then loops to select another, then another until finished then exit. with a check in the script for dups in case of fat finger error is had in selecting one of them in the list.
 
1 members found this post helpful.
Old 06-18-2019, 03:50 PM   #17
FOSSilized_Daemon
Member
 
Registered: Mar 2019
Posts: 188

Original Poster
Rep: Reputation: 13
Quote:
Originally Posted by BW-userx View Post
I have not seen what you got, but was thinking if you're getting more than one net you can put into your wpa file, me I'd try to figure it out how to put all of that information into maybe an array and in a loop so I can select one, then loops to select another, then another until finished then exit. with a check in the script for dups in case of fat finger error is had in selecting one of them in the list.
I am trying to figure out how to make it so I can run the script with a -s and then I can add the wpa file part.
 
Old 06-18-2019, 04:48 PM   #18
michaelk
Moderator
 
Registered: Aug 2002
Posts: 18,698

Rep: Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746
I posted how to find just a wireless adapter in an earlier post.

If the output of the iw scan for a particular AP shows RSN that indicates a WPA2 protected network and WPA as WPA protected network.

If all you see is "capability: ESS Privacy" without a RSN or WPA then that access point is using WEP otherwise it is open as far as I know.
 
1 members found this post helpful.
Old 06-18-2019, 05:54 PM   #19
FOSSilized_Daemon
Member
 
Registered: Mar 2019
Posts: 188

Original Poster
Rep: Reputation: 13
Quote:
Originally Posted by michaelk View Post
I posted how to find just a wireless adapter in an earlier post.

If the output of the iw scan for a particular AP shows RSN that indicates a WPA2 protected network and WPA as WPA protected network.

If all you see is "capability: ESS Privacy" without a RSN or WPA then that access point is using WEP otherwise it is open as far as I know.
I am gonna have to find someone else who can help me finish up this script.
 
Old 06-18-2019, 06:14 PM   #20
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,156
Blog Entries: 11

Rep: Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077
Quote:
Originally Posted by FOSSilized_Daemon View Post
I am gonna have to find someone else who can help me finish up this script.
That seems a bit unappreciative of those who have taken time to reply.

It would be better if you tried to understand why the advice already given either is applicable to the problem or is not applicable, and follow up on that. Simply dismissing the efforts of those trying to help and asking for "new" volunteers is a bit rude and may lead to your questions being ignored by some members.

Please review the Site FAQ for guidance in posting your questions and general forum usage. Especially, read the link in that page, How To Ask Questions The Smart Way. The more effort you put into understanding your problem and framing your questions, the better others can help!
 
Old 06-18-2019, 07:38 PM   #21
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware 14.2 current / ArcoLinux / Void Linux
Posts: 8,864

Rep: Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851
wow really? as astrogeek said, and maybe its more like you rather have someone else write it, actually. Perhaps you bit off more than you can chew. try backing off and just getting one part of it to work first. Then build off of that.
 
Old 06-18-2019, 08:48 PM   #22
FOSSilized_Daemon
Member
 
Registered: Mar 2019
Posts: 188

Original Poster
Rep: Reputation: 13
Quote:
Originally Posted by astrogeek View Post
That seems a bit unappreciative of those who have taken time to reply.

It would be better if you tried to understand why the advice already given either is applicable to the problem or is not applicable, and follow up on that. Simply dismissing the efforts of those trying to help and asking for "new" volunteers is a bit rude and may lead to your questions being ignored by some members.

Please review the Site FAQ for guidance in posting your questions and general forum usage. Especially, read the link in that page, How To Ask Questions The Smart Way. The more effort you put into understanding your problem and framing your questions, the better others can help!
I have looked at the advice and I apricate it (as you can see I even made changes based on it), but a friend also wants this to run on this his machine, so instead of making this thread longer I am going to do the last few parts (as they get very specific for OpenBSD to work with it) with him. It isn't that "Oh I have to have someone do it for cause I am lazy" it's I want this to be POSIX and also work with the OpenBSD system which does something differently. It also has to do with how things get done specific to our setups.
 
Old 06-18-2019, 08:49 PM   #23
FOSSilized_Daemon
Member
 
Registered: Mar 2019
Posts: 188

Original Poster
Rep: Reputation: 13
Quote:
Originally Posted by BW-userx View Post
wow really? as astrogeek said, and maybe its more like you rather have someone else write it, actually. Perhaps you bit off more than you can chew. try backing off and just getting one part of it to work first. Then build off of that.
I responded above, but want to make sure my intentions are clear. I am not meaning to be rude or come off as ungrateful, it is just do to the system I am working with.

I have looked at the advice and I apricate it (as you can see I even made changes based on it), but a friend also wants this to run on this his machine, so instead of making this thread longer I am going to do the last few parts (as they get very specific for OpenBSD to work with it) with him. It isn't that "Oh I have to have someone do it for cause I am lazy" it's I want this to be POSIX and also work with the OpenBSD system which does something differently. It also has to do with how things get done specific to our setups.
 
Old 06-19-2019, 01:34 AM   #24
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 11,771
Blog Entries: 9

Rep: Reputation: 3142Reputation: 3142Reputation: 3142Reputation: 3142Reputation: 3142Reputation: 3142Reputation: 3142Reputation: 3142Reputation: 3142Reputation: 3142Reputation: 3142
tl;dr.

Quote:
Originally Posted by FOSSilized_Daemon View Post
my goal is to remove networkmanager.
and rightly so.
IIRC, netctl comes with a script called wifi-menu; it has been my sole option on the laptop I used and works sufficiently well.
 
Old 06-19-2019, 03:00 PM   #25
FOSSilized_Daemon
Member
 
Registered: Mar 2019
Posts: 188

Original Poster
Rep: Reputation: 13
Quote:
Originally Posted by michaelk View Post
My home WAP just quit while I was trying to update my command but it seems you got it.

I would add some checks so that your not trying to scan for networks or ask for a SSID or password on an ethernet adapter.
Hello, me and a friend both added everything we could. He did some in bash and I ported it to POSIX, currently we have this: https://gitlab.com/Puffles_the_Drago...ts/con-wifi.sh and we are working on the

Code:
attempt to connect to the network, if that fails due to it being a wpa network then ask the user for the password for the network
I am just responding in case you are interested. Thank you and everyone else who has offered help and advice. In case anyone is wanting to offer further assistance I am just looking for a few people with different systems to test this to see if it works on a few different systems.
 
Old 06-19-2019, 03:46 PM   #26
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware 14.2 current / ArcoLinux / Void Linux
Posts: 8,864

Rep: Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851Reputation: 1851
you say you're having an issue with a passwd, in your function
Code:
connect_network() {
	# pick SSID and SSID Password
	read -p "which network would you like to connect to? " ssid
	read -p "what is the network password? " key

	# associate the interface with desired ESSID
	sudo iwconfig $inet essid $ssid

	# save connection details if -s passed
	if [ $save_nwid -eq 1 ]; then
		save_network
	fi
}
I see you asking for a passwd but never checking to see if one is there (first), then using it if it is given a passwd to use. or the option to bypass the passwd if no passwd is needed.


https://blog.tdstelecom.com/products...word-and-ssid/

Last edited by BW-userx; 06-19-2019 at 03:47 PM.
 
Old 06-19-2019, 04:39 PM   #27
michaelk
Moderator
 
Registered: Aug 2002
Posts: 18,698

Rep: Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746
One suggestion would be to list only wireless interfaces in your setup_interface function instead of everything.

Code:
sudo iw dev | grep "Interface" | awk '{print $2}'
Very ugly but this checks for a wpa2 network and it can break with a hidden SSID.
Code:
iw dev wlo1 scan | grep "SSID: \|RSN" |awk '{ORS = (NR % 2 == 0)? "\n" : " "; print}'| grep $ssid
As far as I know here are the current commands to connect from the CLI. I don't know if wpa_passphrase will work from stdin versus a prompt. You can create a different conf file, restart wpa_supplicant for temp connection and then save to wpa_supplicant.conf.

Code:
wpa_passphrase $ssid >> /etc/wpa_supplicant.conf (wpa_passphrase will prompt for a password and appends to exists conf file)
wpa_supplicant -B -D wext -i $inet -C /etc/wpa_supplicant.conf
dhclient $inet
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wifi option is there but no wifi scanning or wifi not working Aakash447 Linux - Newbie 3 06-28-2018 11:48 PM
Want to share my wifi by creating a wifi hotspot ( While staying connected to wifi)? shadyXV Linux - Desktop 4 07-20-2015 05:37 PM
Need tips on using Ethernet to power WiFi network, and tips on setting up WiFi crabpot8 Linux - Networking 2 08-24-2009 06:42 PM
P5B Deluxe wifi (sound/wifi help on 12.0) kniwor Slackware 11 02-14-2008 01:01 AM
Need Wifi Card I Need Help! Linux lowlux Linux - Hardware 7 07-19-2007 03:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration