LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 01-06-2010, 05:43 AM   #16
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290

Hi,

That indeed is the sudoers file, but don't just edit it like that. You have to use:
Code:
sudo visudo
as a user in order to edit it. To check out if you are of the admin group (which I think you are if you're the only user, and since you can use sudo), type in a terminal as your user:
Code:
id
and it'll show you all the groups and ids assigned to your user.

Kind regards,

Eric
 
Old 01-06-2010, 05:46 AM   #17
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Also, what would be very useful to you is to look at the sudoers man page:
Code:
man sudoers
It's pretty extensive reading but I think worth the while. You can set a lot in the sudoers list.

Kind regards,

Eric
 
Old 01-06-2010, 05:47 AM   #18
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Original Poster
Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by EricTRA View Post
Hi,

That indeed is the sudoers file, but don't just edit it like that. You have to use:
Code:
sudo visudo
as a user in order to edit it. To check out if you are of the admin group (which I think you are if you're the only user, and since you can use sudo), type in a terminal as your user:
Code:
id
and it'll show you all the groups and ids assigned to your user.

Kind regards,

Eric
Hello once again Eric.

"id" returns:
Code:
andrew@mylinuxbox:~$ id
uid=1000(andrew) gid=1000(andrew) groups=4(adm),20(dialout),24(cdrom),46(plugdev),104(lpadmin),115(admin),120(sambashare),1000(andrew)
 
Old 01-06-2010, 05:48 AM   #19
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Quote:
Originally Posted by leopard View Post
Hi. I re-did the file to those specifications, and it resulted in the said flashing of the terminal with no output or action. (It flashes very fast so I can't really see if anything happened but the command "airodump-ng" should result in sustained output)
Did you still leave a
Code:
sudo su
in your script? I think it's best to leave it out of the script and just use it like this:
Code:
sudo yourscriptname
Kind regards,

Eric
 
1 members found this post helpful.
Old 01-06-2010, 06:03 AM   #20
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Original Poster
Rep: Reputation: 146Reputation: 146
Thanks Eric!

That did the trick. I made a GNOME menu entry and used "gksudo /home/andrew/Desktop/airodump-ng_auto" (airodump-ng_auto was my script name) and it worked like a charm.

I attached a few screenshots of the script in action!

Last edited by lupusarcanus; 03-07-2010 at 02:20 AM.
 
Old 01-06-2010, 06:05 AM   #21
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello Andrew,

Glad you got it running as you wanted. If you consider your thread as solved please mark it as such using the Thread Tools.

Kind regards,

Eric
 
Old 01-06-2010, 06:13 AM   #22
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Original Poster
Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by EricTRA View Post
Hello Andrew,

Glad you got it running as you wanted. If you consider your thread as solved please mark it as such using the Thread Tools.

Kind regards,

Eric
Sure did! It's in my sig! +3 Thank Icon clicks!

Here is the script that I used for future reference of this thread.

Code:
#! /bin/bash
service network-manager stop
ifconfig wlan0 down
iwconfig wlan0 mode monitor
ifconfig wlan0 up
airodump-ng wlan0
 
Old 01-06-2010, 08:12 AM   #23
vrmartin2
Member
 
Registered: Dec 2009
Location: NE Ohio
Distribution: Open SUSE
Posts: 43

Rep: Reputation: 19
&& vs ||

Also note that you join commands with && if you want to stop the sequence if any of the commands fail. "echo 1 && echo 2" means echo 1 and if that statement succeeds, then run the command "echo 2" and on and on any number of commands. On the other hand "echo 1 || echo 2" means run "echo 1" and then only if that fails, run "echo 2"

And if you really don't care what the return status is or the return status is undefined (unlikely on Linux but very prevalent in Windows) then just use the semicolon (";").

Last edited by vrmartin2; 01-06-2010 at 08:13 AM. Reason: spelling correction
 
Old 01-06-2010, 08:55 AM   #24
internetplayer
LQ Newbie
 
Registered: Jan 2010
Posts: 5

Rep: Reputation: 0
it looks great to me i am curious to know further.
 
  


Reply

Tags
bash, command, sequence


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
some problems related to Linux usage amit12sept Linux - Newbie 1 11-05-2008 06:49 AM
A couple of questions about command line usage MasterOfTheWind Linux - General 14 10-04-2007 01:20 PM
Bash command questions xeon123 Linux - General 2 09-20-2007 02:58 PM
basic questions on hostname and domain name + related postfix questions Moebius Linux - Newbie 7 09-04-2007 11:50 AM
2 bash related questions mobilemonkey Slackware 10 05-25-2007 06:28 PM


All times are GMT -5. The time now is 03:44 PM.

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