| Not a member yet? Register for FREE! |
| ||||||
| Computers & Gadgets A great place to discuss computers, gadgets and the internet. PC, laptop, firefox, ie, linux, mac, ipods, digital cameras and more. |
| JOIN TODAY! It's FREE . . . Discuss topics and issues that matter to you!
8,000 active members posting their views, facts and opinions on issues and topics that are important to people of today. Join a Discussion or better yet and Start a Discussion of your own! |
![]() |
| | Thread Tools |
| | #1 (permalink) |
| Moderator Join Date: May 2007 Location: Indiana, USA
Posts: 1,648
| I have a script. Code: #!/bin/bash if iwlist eth0 scanning | grep -q 'ESSID1' then iwconfig eth0 essid ESSID1 key WEP-KEY && dhclient eth0 elif iwlist eth0 scanning | grep -q 'ESSID2' then iwconfig eth0 essid ESSID2 && iu-vpn-ipsec start fi P.S. I also asked on ubuntuforums, but haven't gotten a positive answer yet. |
| "Give a man fire, and he will be warm for a day; set a man on fire and he will be warm for the rest of his (short) life."---Wofl | |
| | |
| | #2 (permalink) |
| Chuck Norris Join Date: May 2007 Location: London, England
Posts: 330
| i can only recommend what i use for sudo, i use Code: echo "password" | sudo -S insertcommandhere Code: echo "password" | iu-vpn-ipsec start |
| http://www.venganza.org/about/open-letter/ "Creationism is not a scientific alternative to natural selection any more than the stork theory is an alternative to sexual reproduction." — Hayes, 1996. | |
| | |
| | #3 (permalink) |
| Agitator Join Date: May 2007 Location: a pale blue dot
Posts: 635
| |
| I'm a simple man with complex tastes. (Calvin & Hobbes) >> http://c.dric.be/gium >> http://bookmarks.c.dric.be/ | |
| | |
| | #4 (permalink) |
| Moderator Join Date: May 2007 Location: Indiana, USA
Posts: 1,648
| Well, it doesn't work in my case. It gives me Code: stty: standard input: Invalid argument |
| "Give a man fire, and he will be warm for a day; set a man on fire and he will be warm for the rest of his (short) life."---Wofl | |
| | |
| | #5 (permalink) |
| Eligible for a custom title Join Date: May 2007 Location: Indiana, USA
Posts: 791
| for complex interactive tools, the "expect" tool is probably the most powerful. Otherwise for simple scripts you can do something like: sudo umount /media/disk << eob YOURPASSWORD eob (the eob just marks a "here" document ... can be any unique string) |
| | |
| | #6 (permalink) |
| Moderator Join Date: May 2007 Location: Indiana, USA
Posts: 1,648
| Yeah, I think "expect" is going to be the way to go. A guy suggested it on ubuntuforums. It's kinda more advanced than I am though, so I'll have to spend some time learning how to make it work. If you know a beginner's tutorial for it, I'd appreciate it if you'd link it. |
| "Give a man fire, and he will be warm for a day; set a man on fire and he will be warm for the rest of his (short) life."---Wofl | |
| | |
| | #7 (permalink) |
| Eligible for a custom title Join Date: May 2007 Location: Indiana, USA
Posts: 791
| this tutorial seems to cover most things you'd need. http://floppsie.comp.glam.ac.uk/Glam...ripting/5.html it probably looks worse than it really is, but the two main commands are just 'send' and 'expect' |
| | |
| | #8 (permalink) |
| Moderator Join Date: May 2007 Location: Indiana, USA
Posts: 1,648
| Thanks, yaarrrggg. I'll give it a look. |
| "Give a man fire, and he will be warm for a day; set a man on fire and he will be warm for the rest of his (short) life."---Wofl | |
| | |
| | #9 (permalink) |
| Chuck Norris Join Date: May 2007 Location: London, England
Posts: 330
| that looks a more elegant solution than echo and pipe i might have to look into that myself ^^ |
| http://www.venganza.org/about/open-letter/ "Creationism is not a scientific alternative to natural selection any more than the stork theory is an alternative to sexual reproduction." — Hayes, 1996. | |
| | |
| | #10 (permalink) |
| Moderator Join Date: May 2007 Location: Indiana, USA
Posts: 1,648
| Beautiful. I think it worked. I won't know for sure until I try it at school, but it looks like it's working. Thanks. |
| "Give a man fire, and he will be warm for a day; set a man on fire and he will be warm for the rest of his (short) life."---Wofl | |
| | |
| | #11 (permalink) |
| Discussion starter | As always, keep in mind the security risks behind these methods. They all require the password to be pre-stored somewhere. Make sure no one but trusted people can even touch the file containing your root password. You probably already knew this, but someone has to say it. ![]() |
| Quote:
| |
| | |
| | #12 (permalink) | |
| Moderator Join Date: May 2007 Location: Indiana, USA
Posts: 1,648
| Quote:
I wouldn't do it on a computer that others could get to; it's on my laptop that stays with me. So if you want to access my computer, you need to beat me up first ... and if you do that, frankly my password is the least of my worries. | |
| "Give a man fire, and he will be warm for a day; set a man on fire and he will be warm for the rest of his (short) life."---Wofl | ||
| | |
| | #13 (permalink) | |
| Discussion starter | Quote:
![]() | |
| Quote:
| ||
| | |