Results 1 to 10 of 10
  1.    #1  
    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.
  2. #2  
    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.
  3. #3  
    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.
    Last edited by rsanchez1; 02/01/2011 at 04:09 PM.
  4. crabbz's Avatar
    Posts
    78 Posts
    Global Posts
    156 Global Posts
    #4  
    The backup/restore app in preware uses shell scripts but I don't know how it calls them.
  5.    #5  
    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
  6. #6  
    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.
  7. Mordac's Avatar
    Posts
    49 Posts
    Global Posts
    77 Global Posts
    #7  
    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.
  8.    #8  
    I got it to work using robvanvliet's post, but thankyou anyway
  9. Mordac's Avatar
    Posts
    49 Posts
    Global Posts
    77 Global Posts
    #9  
    Quote Originally Posted by tesseract View Post
    I got it to work using robvanvliet's post, but thankyou anyway
    Good deal!

    Would you mind sharing your script to feed username/password into the webpage? I'm in a similar situation and it could be useful.

    Thanks,
    -M
  10.    #10  
    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
    as in robvanvliet's case, I saved that into /etc/network/if-up.d/ and added a line to the end of /etc/pmnetconfig/if-up to make it run.

    Obviously, the variables will be different for your webpage - check the documentation for curl for more information.

Tags for this Thread

Posting Permissions