LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-24-2015, 02:22 AM   #1
Adman49
LQ Newbie
 
Registered: Feb 2015
Location: Alberta, Canada
Distribution: Slackware Linux 14.1
Posts: 4

Rep: Reputation: Disabled
Wireless connection at logon


I'm a Newbie and I'm wanting to know if it's possible to have a automatic script to connect to my home wireless connection after it has failed to locate an ethernet connection (and before logon).

If so, what details should be in the script and where should the script be placed?

Thank you for any assistance you may provide.
 
Old 02-24-2015, 04:59 AM   #2
fatmac
Senior Member
 
Registered: Sep 2011
Location: Surrey/Hants Border, UK
Distribution: BSD & Linux - As long as they are Lightweight
Posts: 1,491

Rep: Reputation: Disabled
Depends on your distro, but basically you need to set it up before you can connect to the internet. Look for an application, usually under network in your menu, to help you get it set up. You may also need some firmware to be able to use it.
 
Old 02-24-2015, 02:07 PM   #3
Adman49
LQ Newbie
 
Registered: Feb 2015
Location: Alberta, Canada
Distribution: Slackware Linux 14.1
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you for your response.

My Bad. In the future I will start my message with my distro: Slackware Linux 14.1.

Hardware:

No name laptop with 8GB RAM,512GB SSD partitioned for Windows 7, two NTFS drives, one swap drive and Slackware drive with LILO boot screen.

Network Adapter: Realtek PCIe GBE Family Controller
Network Adapter: Atheros AR9002WB-1NG Wireless Network Adapter

The "Realtek PCIe GBE Family Controller" I presume to be the ethernet adapter and the "Atheros AR9002WB-1NG Wireless Network Adapter" would be the one that requires the script.

Now, I'm confused about whether I should modify "/etc/rc.d/rc.wireless", "/etc/rc.d/rc.wireless.conf", "/etc/rc.d/rc.inet1", "/etc/rc.d/rc.inet1.conf" or some other file...
 
Old 02-24-2015, 06:33 PM   #4
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,429

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
The use of "/etc/rc.d/rc.wireless"and "/etc/rc.d/rc.wireless.conf" is deprecated in Slackware 14.1.

You specify that you want to do this before login, which is a little unusual. Most people are happy to login and then set the network interface that they want to use using NetworkManager or wicd (or the command line equivalents nmcli or wicd-client).

To achieve your aim, I would add the configuration options for the wired and wireless interfaces to /rc/rc.inet1.conf and then edit /etc/rc.d/rc.M and specify the wired interface as the one that you want to start.
Code:
# Initialize the networking hardware.
if [ -x /etc/rc.d/rc.inet1 ]; then
  . /etc/rc.d/rc.inet1 eth0_start
fi
I would then add code to /etc/rc.d/rc.local to test if the wired interface was connected, and if not, then start the wireless interface. The following code is not tested, but should give you some ideas.
Code:
if ! ifconfig | grep -q eth0 ; then
  if [ -x /etc/rc.d/rc.inet1 ]; then
    . /etc/rc.d/rc.inet1 wlan0_start
  fi
fi
 
Old 02-25-2015, 11:29 AM   #5
Adman49
LQ Newbie
 
Registered: Feb 2015
Location: Alberta, Canada
Distribution: Slackware Linux 14.1
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you for your response.

It appears to work but when I run Firefox, any website that I try to connect with just display the "whirling circle" in the tab...

I think I will abandon this road and be content with using the wicd-client.
 
Old 02-25-2015, 06:20 PM   #6
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,429

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
The "whirling circle" suggests that the browser is not able to resolve addresses. You may need to run 'dhcpcd' so that DNS resoulution is properly setup.
You should check the contents of /etc/resolv.conf.
 
Old 02-25-2015, 07:20 PM   #7
Adman49
LQ Newbie
 
Registered: Feb 2015
Location: Alberta, Canada
Distribution: Slackware Linux 14.1
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you for your response.

I've already restored the script files to their original versions and trashed my edits. I would like to thank you for your time and effort but I think I will go with your suggestion: "NetworkManager or wicd (or the command line equivalents nmcli or wicd-client)."
 
  


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
[SOLVED] DSL connection slow on Linux wired connection but fast on Windows wireless Pandarsson Linux - Wireless Networking 9 12-17-2010 06:55 PM
Display of number of failed logon attempt...at logon DorsetBlue Linux - Security 5 01-26-2010 10:47 AM
Have to reinit wireless every logon with Compaq Presario laptop Effervex Linux - Wireless Networking 4 09-08-2009 07:20 PM
wireless authentication prior to ldap logon njpruess Linux - Wireless Networking 3 11-30-2007 10:29 AM
no internet connection on linux box but XP can logon to domain kenji1903 Linux - Networking 4 07-27-2004 10:02 PM


All times are GMT -5. The time now is 10:27 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