LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices

Reply
 
Search this Thread
Old 10-10-2006, 12:43 PM   #1
kbutcher5
Member
 
Registered: Jun 2006
Distribution: Arch and yes winblows on one :P
Posts: 105

Rep: Reputation: 15
Terminal Wireless tool...


I have made a bash wireless tool to configure wireless very easily, it has probably been seen before, but i have constructed it to learn bash scripting.
My friend suggested to upload it, so here it is.
I have ideas for a wpa expansion later on, but it might be a while. Ideas and suggestions will be appreciated
The script is currently at v0.3!
Wireless Tool v0.3
 
Old 10-10-2006, 05:50 PM   #2
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 61
Link not pointing correctly. You can use the code option and post the script contents in your post. Example of it. Note remove the _ in the code line.
[_code_]
Insert text here. Remove the _ before and after the word code. Had to do it this way to show in text.
[_/code]
Brian
 
Old 10-11-2006, 05:30 PM   #3
kbutcher5
Member
 
Registered: Jun 2006
Distribution: Arch and yes winblows on one :P
Posts: 105

Original Poster
Rep: Reputation: 15
Well people can just dl it and read it, and btw the sudo install part only works for arch atm...
well here is the code:
Code:
#!/bin/bash
echo "Automatic Wireless setup tool v0.3"
echo "Remember to be root!"
echo "Remember to be root!"
echo "Remember to be root!"
sleep 4
clear
echo "Choose wireless settings, 1=Essid 2=Channel 4=Wep Key."
echo "If you want more than one setting, just add them together."
echo "Remember essid is required!"
read opt
echo "Wireless Card interface name:"
read ycard

beg ()
{
echo "#!/bin/bash" > /usr/bin/wire
echo "echo Booting Card..." >> /usr/bin/wire
echo "sudo ifconfig $ycard up" >> /usr/bin/wire
echo "echo AP Scan:" >> /usr/bin/wire
echo "sleep 1" >> /usr/bin/wire
echo "iwlist $ycard scan" >> /usr/bin/wire
}

essid ()
{
        echo "echo Define essid:" >> /usr/bin/wire
        echo "read ysid" >> /usr/bin/wire
        echo -e "sudo iwconfig $ycard essid \$ysid" >> /usr/bin/wire
}

channel ()
{
        echo "echo Define channel:" >> /usr/bin/wire
        echo "read ychan" >> /usr/bin/wire
        echo -e "sudo iwconfig $ycard channel \$ychan" >> /usr/bin/wire
}

wep ()
{
        echo "echo Define wep key:" >> /usr/bin/wire
        echo "read ywep" >> /usr/bin/wire
        echo -e "sudo iwconfig $ycard key \$ywep" >> /usr/bin/wire
}

if [ $opt -eq "1" ]; then
        beg
        essid
elif [ $opt -eq "3" ]; then
        beg
        essid
        channel
elif [ $opt -eq "5" ]; then
        beg
        essid
        wep
elif [ $opt -eq "7" ]; then
        beg
        essid
        channel
        wep
else
        echo "Wrong wireless settings chosen!!!"
        exit
fi

echo "echo Arp request..." >> /usr/bin/wire
echo "sudo dhcpcd $ycard" >> /usr/bin/wire
echo "echo Wireless Running!" >> /usr/bin/wire
echo "Copyright by MentalButcher"
chmod 777 /usr/bin/wire
pacman -Qs sudo > sudo
read sudoi <sudo
rm sudo
if [ -z "$sudoi" ]; then
                pacman -S sudo --noconfirm
                echo "Sudo installed!"
else
                echo "Sudo already installed, continuing..."
fi
grep /sbin/dhcpcd /etc/sudoers > sudo
read chk <sudo
rm sudo
if [ -z "$chk" ]; then
                echo "ALL ALL=(root) NOPASSWD: /sbin/ifconfig, /usr/sbin/iwconfig, /sbin/dhcpcd" >> /etc/sudoers
                echo "Sudo Set!"
else
                echo "Sudo config already set, continuing..."
fi
echo "Processing done, type wire to start utility!"
echo "Copyright by MentalButcher"
exit

Last edited by kbutcher5; 07-11-2007 at 06:12 AM.
 
Old 10-13-2006, 02:11 PM   #4
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 61
Nice little script. Very simply and clean looking.

Brian
 
Old 10-13-2006, 05:11 PM   #5
kbutcher5
Member
 
Registered: Jun 2006
Distribution: Arch and yes winblows on one :P
Posts: 105

Original Poster
Rep: Reputation: 15
thx man, but as you see it uses arch's package manager to get sudo, but i was thinking to make it check for linux type aswell in the next version, get it to work for dpkg aswell, and maybe rpm, though i do not know how it works, anyone able to help?
 
Old 11-03-2006, 02:30 AM   #6
trubled
LQ Newbie
 
Registered: Nov 2006
Location: VIC, Australia
Distribution: Winsux is one i partition it with WinServer 2KPOO ,And FreeBSD
Posts: 18

Rep: Reputation: 0
Great stuff mate :-)
Kepp up the good work, and if wantr to look at an advanced generator check: www.rootkit.nl 'FreeBSD Shell/Script installer' suit back and have codffee abd watch it instakk every needed port i guess I loive that sites tools, ecuae i have used lclam, and spam assassin, and i got a better reult using that, also he allows his users to keep a GREAT feedback/suggests with him, to point he would add code if it is ok..
anyhow i must go a kangaroo just ran past swingin punches.. wooops.. better go!@

OH and this idea ROCKZ0RS, try it if you can get the Imagebases you may need...
 
Old 11-03-2006, 02:32 AM   #7
trubled
LQ Newbie
 
Registered: Nov 2006
Location: VIC, Australia
Distribution: Winsux is one i partition it with WinServer 2KPOO ,And FreeBSD
Posts: 18

Rep: Reputation: 0
thx man, but as you see it uses arch's package manager to get sudo, but i was thinking to make it check for linux type aswell in the next version, get it to work for dpkg aswell, and maybe rpm, though i do not know how it works, anyone able to help?


DO IT, make it pick between the BEST packages...but makesure it staytds opem src fpr atleast abit lik e.. mm 1 month cheers..dunno why it did not join to my other mail but meg=h.. i getin to like this place. I will practice english now and get even a turir
 
Old 11-03-2006, 03:34 AM   #8
kbutcher5
Member
 
Registered: Jun 2006
Distribution: Arch and yes winblows on one :P
Posts: 105

Original Poster
Rep: Reputation: 15
i do know the apt-get version, but i don't know how to integrate rpm, since i have never tried it and never will..
 
Old 11-04-2006, 12:48 AM   #9
trubled
LQ Newbie
 
Registered: Nov 2006
Location: VIC, Australia
Distribution: Winsux is one i partition it with WinServer 2KPOO ,And FreeBSD
Posts: 18

Rep: Reputation: 0
Hmm.. im a checkout the freebsd one, and maybe look for some apps open-src/codeproj

Well i was kinda thinking,if you were to integrate apt-get, and pkg_get ,thats almost most distros out there.. i mean bsd will allow apt-get if you install the rpms. so io know it ain't a prob.. heck, i could get started on working on it in cygwin and will make 0 dif :P the one main concern is akll the cronjobs running.. how are you intending to exactly start each separate user, time setting i assume would be the best idea, someone also in the thread mentioned forcing it to check cron every 5minutes and i wonder why need to do that but of course everymaybe 20mins if that is the way you will get aboiut it, also, this wouldb be really modified at time of adding a new user, after coding it, and using it in debug , (I dont see ANY debug in it mind you, and debug is extremely important, you don't know if it is even exploitable, imagine your small tools is exploitable by way of using bad sh command :P .
I rgink, the apt-get , and/or getting to ports which would be easy using the script i showed you for bsd, and might be worth mailing him your script, and showing him what ya want to do, he is a busy guy but i am sure he will like the work, and not all bsd users just use that..
Also, remember to keep yourself a GOOD changelog incase you see any ideas, you should keep that for sure, i think by the v10 or whatever, it should be workable for ANY Linux or Unix (Mainstream/Corp) use, wich could lead you to make a version mayne online like Michael, or just supply it free, or based on donations.. heck i know i paid when whoppix was new, and i wanted to see more..so i cant see why not ever support a team doing dev work i've done it and still do!It is very hard to co ordinate even the best of svn's or simply getting things to run in coexistence.
Think of yourself as a bit of a gy with a mission, to make your installer, the est one, and even if you made open a vers for development users (thats another thing, this could almost be aother BerliOS is that big!).
You could just make sure you use the 'Creative Commons' license god-bless-it,as it will completely cover your work/you, and always make sure that if the code is reused, you are always to be given a copy no matter what it is said or made for, the author should always see his work, at work for others debug is one thing ya need tho i would add it before moving on, and start maybe an ideas+changes log, it will only be as excellent as you are enthusiastic to make it
I wish you the best and will hopefully see you at it and use it so,eday , get a 5.5BSD one up and ill be a beta tester.
Heck,ill install some Linux for find even so sure.. ain't hard to find some decent beta helpers especially if it stays very stable and maintanable / maintained.
Cheers / DX

wireless bsd
 
Old 11-04-2006, 09:49 AM   #10
kbutcher5
Member
 
Registered: Jun 2006
Distribution: Arch and yes winblows on one :P
Posts: 105

Original Poster
Rep: Reputation: 15
I think i will be needing a shorter version of that, because i don't really understand all of it.
I think i know what you are getting at, but it is just bash script, anyone could have made it, just a bunch of linux commands that get's executed without touching anything.

I was thinking of just dumping the project, it works for what i need it for, maybe rebuild a graphical version of it in C.
But until then, i've only fixed a few bugs in it, and it should do the trick for most people.
 
Old 11-04-2006, 09:59 AM   #11
kbutcher5
Member
 
Registered: Jun 2006
Distribution: Arch and yes winblows on one :P
Posts: 105

Original Poster
Rep: Reputation: 15
V0.4 is here, if you want it, just take it :P

Changes list since V0.1:
Automatic check of exsistence of sudo.
Automatic download of sudo.
Automatic check of allowance of wireless actions in sudo.
Automatic allowance of wireless actions in /etc/sudoers
Choice between 4 setups wireless defined by:
Essid
Essid and Wep key
Essid and channel
Essid, channel and wep key

Let's you define which card to use.

Changes list in V0.4:
Just fixed a few bugs that made some stuff run outside the script.

Wireauto V0.4
 
  


Reply

Tags
terminal, tool, wireless


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
Fixed Wireless Terminal sucram2g Linux - Hardware 2 06-08-2006 05:06 AM
configure wireless from terminal xemophora Suse/Novell 3 11-29-2005 01:08 PM
Best Tool for Wireless Management in Mandrake 10.1 deepfrybonanza Linux - Wireless Networking 6 02-18-2005 08:00 PM
Wireless Packet Re-assembly Tool prompt Linux - Wireless Networking 2 11-19-2004 02:32 PM
Is there a graphical wireless management tool (like Windows has)? CSIXTY4 Linux - Wireless Networking 2 08-18-2004 09:12 PM


All times are GMT -5. The time now is 04:49 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration