LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-09-2013, 01:28 AM   #1
abarone77
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Rep: Reputation: 0
Wireless script at startup


Hi,

I made a script in order to connect to my wireless network as follow

Code:
#!/bin/bash
ifconfig wlan0 up
wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B
dhclient  -4 -nw wlan0
and this script works fine when I execute it on terminal
but I want to make it run at startup.
What I have done so far were:

copy to /etc/init.d/script.sh
run the command
Quote:
update-rc.d script.sh defaults
and edit rc.local :
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
script.sh
exit 0
but I have no success so far.

my distro is Ubuntu 64bits 13.04

thanks,
abarone77

Last edited by abarone77; 06-09-2013 at 02:17 AM. Reason: Solved
 
Old 06-09-2013, 02:17 AM   #2
abarone77
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Original Poster
Rep: Reputation: 0
I solved this issues by putting the commands on /etc/rc.local
Quote:
ifconfig wlan0 up
wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B
dhclient -4 -nw wlan0
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
#/etc/init.d/script.sh 
ifconfig wlan0 up
wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B
dhclient  -4 -nw wlan0 
exit 0

Last edited by abarone77; 06-09-2013 at 02:19 AM.
 
  


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
Startup Script I wrote for Wireless -works on slackware The Gargantuan Linux - Software 1 07-21-2010 03:47 PM
Startup Errors with wireless networking Error for wireless request "Set Encode" Cryptoniks Linux - Wireless Networking 1 03-21-2006 08:06 AM
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 03:53 AM
How to call a script from a system startup script? jonatito Linux - Newbie 7 11-11-2005 10:40 PM
My Wireless Script on Startup Jamel75 SUSE / openSUSE 2 02-05-2005 05:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:14 AM.

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
Open Source Consulting | Domain Registration