• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Running a shell script in browser automatically

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a linux application. The installer for this application is streamed from the server with a mime type of "application/x-sh".

When the browser receives this streamed data, it displays a message asking the user to
1. select a program to open with and displayes a browse button or
2. save it to disk.

I want to change this behavior, so that the user is presented with an option to open with "sh" automatically. The user should not be made to click the browse button and than select /bin/sh.

It would be even better if the browser runs this streamed data automatically with the /bin/sh program.

This behavior can be configured from the browser (setting the behavior for .sh file types). But I do not have any control over the user's browser settings.

Is there a way to enforce the desired behavior.

I will appreciate any help/suggestions on it.

Thanks,
Basu.
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it would be possible, we would get the big virus-invasion in linux.

I'm glad, it's not possible.
 
V Chauhan
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree, if the script is executed automatically without the user knowing it, it would be be a big problem.

I am looking for a behavior, which is similar to what happens when an user downloads an executable on Windows. The user should see a pop up displaying an option of opening the script with "sh". The user can choose open the file or save it to the disk.

Any thoughts on how to enforce this behavior.

Thanks in advance,
Basu.
 
Saloon Keeper
Posts: 28663
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Stefan Wagner:
If it would be possible, we would get the big virus-invasion in linux.

I'm glad, it's not possible.



Actually, unless the browser forbids it, it is possible. All that's required is that the MIME definitions for ".sh" files be set to run rather than save, as Basudev notes.

Firefox does support download/run-with option dialogs for things like ZIP files, so there's probably a MIME preference for that, however, it's at the user's control, not the webservers and thank goodness that's so or we would get the "big virus-invasion".

Even if the option were available, however, I'd not want it. Windows users are notorious for clicking the "OK" button, and despite the elitist attitudes of some regarding Unix, I'd not want to wager that a non-geek Unix User is going to be any more discerning that an non-geek Windows user.
 
reply
    Bookmark Topic Watch Topic
  • New Topic