02/01/2011, 02:08 PM
|
#1 (permalink) |
|
Member
![]() Join Date: Feb 2011
Posts: 8
Likes Received: 0
Thanks: 0
Thanked 4 Times in 2 Posts
|
I wasn't sure where to put this, but I think I have the right place..
I want to run a shellscript from Mode Switcher so I can automatically connect to a wireless network that requires you to enter your username and password into a website; I've already written the script, and I'd like to put it as an app into the launcher so I can run it from mode switcher when I connect to the relevant wireless network. Is this possible, and if yes, would you be kind enough to point me in the right direction? I did try to work around the problem by putting the script in /etc/network/if-up.d and having it check the SSID, but both times I tried that (after editing /etc/pmnetconfig/if-up) the internet connections on my pre went haywire, which suggests there was something wrong with my script (god knows what, it was only about five lines long), but as the only thing that seemed to fix it was doctoring the pre, I don't much want to keep trying to debug it. |
02/01/2011, 02:56 PM
|
#2 (permalink) |
|
Member
![]() Join Date: Dec 2009
Posts: 471
Likes Received: 38
Thanks: 334
Thanked 73 Times in 64 Posts
|
I remember seeing in passing long ago that you can't run a shell script from (or as) a WebOS app for security reasons. You might be able to search and find an old thread on this. Someone else chime in if they know for sure.
Last edited by sq5; 02/01/2011 at 03:18 PM. |
02/01/2011, 03:30 PM
|
#3 (permalink) |
|
Member
![]() ![]() Join Date: Sep 2010
Posts: 1,836
Likes Received: 89
Thanks: 55
Thanked 323 Times in 228 Posts
|
I thought this was how some homebrew apps, such as xterm, launched. Yes, xterm can't launch from the launcher as of 1.4.5, but I thought that was more of an issue of the jail configurations in 1.4.5, and not because it launches from a shell script.
Edit: I'm not completely sure if that's the reason why it doesn't work anymore though, so someone who has done this please chime in.
__________________
Grav - Canvas-based Gravity Simulation Last edited by rsanchez1; 02/01/2011 at 04:09 PM. |
02/03/2011, 03:50 PM
|
#5 (permalink) |
|
Member
![]() Join Date: Feb 2011
Posts: 8
Likes Received: 0
Thanks: 0
Thanked 4 Times in 2 Posts
|
Well, thankyou for the contributions; Judging from what you've said (and what I've been able to find on the forums), it's difficult to say the least. So, I'll just try and use if-up and see if I can get it to work.. thankyou
|
02/04/2011, 04:20 PM
|
#6 (permalink) |
|
Member
![]() Join Date: Apr 2005
Location: Eindhoven, Netherlands
Posts: 94
Likes Received: 3
Thanks: 16
Thanked 159 Times in 11 Posts
|
I did more or less the same as you. Have a look here for comparisson:
http://forums.precentral.net/2751620-post18.html Last edited by robvanvliet; 02/04/2011 at 04:27 PM. |
02/04/2011, 04:51 PM
|
#7 (permalink) |
|
Member
![]() Join Date: Aug 2010
Posts: 49
Likes Received: 6
Thanks: 18
Thanked 13 Times in 9 Posts
|
you could have mode switcher launch terminal, and add your script to the .bashrc file
That would make it run every time terminal runs, though, so checking the ssid would be good. |
02/06/2011, 09:49 AM
|
#10 (permalink) |
|
Member
![]() Join Date: Feb 2011
Posts: 8
Likes Received: 0
Thanks: 0
Thanked 4 Times in 2 Posts
|
It depends on how the webpage picks up the username/password, but in my case it was trivial, as it passed the variables via POST to another webpage - so I could just use curl:
Code:
#!/bin/bash ssid=$(iwgetid -s) if [ -z $ssid ]; then exit fi if [ $ssid = "DurhamWebAuthentication" ]; then curl -k -F fname=wba_login -F username=(username) -F key=(password) https://Durham.Web.Portal/aaa/WebAAA.htm fi exit Obviously, the variables will be different for your webpage - check the documentation for curl for more information. |
![]() |
|
| Tags |
| launcher, shellscript |
| Thread Tools | |
| Display Modes | |
|
|



