Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running a shell script in browser automatically

 
V Chauhan
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • 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.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18222
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic