WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TinyCore64 14.0 wifi.sh failures  (Read 3022 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11595
Re: TinyCore64 14.0 wifi.sh failures
« Reply #15 on: February 18, 2024, 10:09:50 PM »
Hi jim
There was a typo in the second change listed in reply #6
that has been corrected.

Offline jim

  • Newbie
  • *
  • Posts: 15
Re: TinyCore64 14.0 wifi.sh failures
« Reply #16 on: February 19, 2024, 10:02:56 AM »
Happily that fixed it.
I am connected at the hotel.
Thank you.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11595
Re: TinyCore64 14.0 wifi.sh failures
« Reply #17 on: February 19, 2024, 12:36:58 PM »
Hi jim
Thank you for confirming it worked. Sorry about the
typo. Hope it didn't cause you too much trouble.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11595
Re: TinyCore64 14.0 wifi.sh failures
« Reply #18 on: February 22, 2024, 12:11:58 AM »
Hi CentralWare
I set the ESSID on my router to:
Code: [Select]
I'm a rule breaker & ! ?\$ * = \
And my modified wifi.sh was able to connect:
Code: [Select]
Select Wifi Network

    ESSID                         Enc   Qual    Channel Type           
 1. I'm a rule breaker & ! ?\$ * = \       on    47      11     WPA
 2. ROMY_WIFI                      on    22       9     WPA
 3. Verizon_Z6DL3H                 on    19       6     WPA

Enter selection ( 1 - 3 ) or (q)uit: 1
Enter password for I'm a rule breaker & ! ?\$ * = \ (8 to 63 characters): PASSWORD
Sending credentials to requested access point I'm a rule breaker & ! ?\$ * = \# reading passphrase from stdin
..
deleting routers
adding dns 192.168.1.1
tc@box:~$

The formatted ESSID wifi.sh placed in wifi.db looks like this:
Code: [Select]
I\'m\ a\ rule\ breaker\ \&\ \!\ \?\\\$\ \*\ \=\ \\ PASSWORD WPA
Try as I might, I couldn't get wifi.sh to accept a percent sign.
It responded with  Invalid format specifier.  Probably a printf
command complaining.

The changes involved adding a bunch of gsub() statements.
Some extra surrounding lines are shown for context.
From this:
Code: [Select]
gsub(" ","\\ ",sid[i])To this:
Code: [Select]
if ( mode == "auto" ) {
print("Attempting auto connection with " autoconnect)
for (i in sid) {
gsub("\134\134","\134\134",sid[i]) # Backslash (must come first)
gsub(" ","\\ ",sid[i]) # Space
gsub("\047","\\\047",sid[i]) # Single quote
gsub("&","\\\\&",sid[i]) # Ampersand
gsub("!","\\!",sid[i]) # Exclamation mark
gsub("?","\\?",sid[i]) # Question mark
gsub("\\$","\\$",sid[i]) # Dollar sign
gsub("\\*","\\*",sid[i]) # Asterisk
gsub("\\=","\\=",sid[i]) # Equal sign
if (autoconnect == sid[i] ) {
associate(type[i],wifi,sid[i],mypass,chan[i])
system( "udhcpc " lease "-i " wifi " -x hostname:" currenthostname " 2>/dev/null" )
exit

And this:
Code: [Select]
gsub(" ","\\ ",sid[selection])To this:
Code: [Select]
if ( offset == 1 && selection != "q") {
sid_display = sid[selection]
password = ""
newitem=""
gsub("\134\134","\134\134",sid[selection]) # Backslash (must come first)
gsub(" ","\\ ",sid[selection]) # Space
gsub("\047","\\\047",sid[selection]) # Single quote
gsub("&","\\\\&",sid[selection]) # Ampersand
gsub("!","\\!",sid[selection]) # Exclamation mark
gsub("?","\\?",sid[selection]) # Question mark
gsub("\\$","\\$",sid[selection]) # Dollar sign
gsub("\\*","\\*",sid[selection]) # Asterisk
gsub("\\=","\\=",sid[selection]) # Equal sign
if ( enc[selection] == "on" ) {
while ( getline dbitem < dbfile > 0 ) {
split(dbitem,field,"\t")

Quote
CAUTION: This subsubsection has been reported to cause headaches.
 You might want to skip it upon first reading.
Found here:
https://www.gnu.org/software/gawk/manual/html_node/Gory-Details.html

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Re: TinyCore64 14.0 wifi.sh failures
« Reply #19 on: February 25, 2024, 10:04:51 AM »
@Rich, sorry it's been a minute; ran into some computer based technical difficulties (of all things that could become corrupt...  my password bible bit the dust?!)
If wifi.sh has been updated on the repo I can just download and investigate; if not, please email me where you left off -- I should be able to do a pass recovery there later this afternoon :)
Thanks!

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11595
Re: TinyCore64 14.0 wifi.sh failures
« Reply #20 on: February 25, 2024, 10:27:42 AM »
Hi CentralWare
No, I didn't touch the repo version. I posted my changes
here so the smart kids can point out any errors for me.

I've emailed a copy of the modified script for you to try out.