LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Autorun a .html file on inserting a DVD (https://www.linuxquestions.org/questions/linux-software-2/autorun-a-html-file-on-inserting-a-dvd-288016/)

ilhbutshm 02-09-2005 04:39 AM

Autorun a .html file on inserting a DVD
 
Hi,

I'm making a DVD for a company with some software on it and I've got a bit of a problem with creating a startup script for linux.

Is this possible at all, because a user has to mount the drive first and I can't really work around that, can I?

Once the drive is mounted, I guess a script like this would suffice:
Code:

#!/bin/sh
dir=$(echo $0 |sed 's/autorun//')
cd $dir
fullpath=$(pwd)
exec /usr/bin/nautilus $fullpath

Or are there other, easier or better solutions?

KimVette 02-09-2005 08:36 AM

if you have a distribution which supports automounting, live polling, and autorun.sh (e.g., Suse), you can just name the file autorun.sh and put it in the root directory of the CD. It "should" work (I haven't actually tried that yet though).

ilhbutshm 02-09-2005 09:37 AM

Which distributions support automounting and live pollin?

And what can I do with distributions that don't support this? It would be nice if a document with instructions and links to programs would open when DVD is inserted.

KimVette 02-09-2005 10:29 AM

If a distribution doesn't support those features, there's nothing you can do, really. It's like asking "if an operating system won't run a Windows application, how can my user run the Application?" - in that case, you need to switch operating system.

The user would have to either find and add the required modules/daemons to add the necessary functionality, or switch distributions. As far as which distributions support autorun.sh, I know for a fact that Suse does, but I don't know which other ones do.

theYinYeti 02-09-2005 11:29 AM

You can hack and run "cdde". I've done it myself for another purpose. It's a well-written program, hence easy to modify.

Yves.

enigmasoldier 02-09-2005 12:29 PM

I know that Fedora Core 3 supports autorun.sh as does the latest SuSE. Actually, any distro with a newer version of gnome should work provided gnome is the window manager. Under preferences and removable storage, you will see the option for autorun.sh on removable storage.

ilhbutshm 02-09-2005 02:03 PM

So it should work under newer versions of gnome... what about KDE?

theYinYeti: but every client should install (or have installed) CDDE to run the start page automagically when a DVD is inserted, right?

At this point I'll probably go with autorun.sh, I guess Linux users are used to mounting the disc manually in reading the docs for instructions and dont really need a startup HTML hello page.

theYinYeti 02-10-2005 02:37 AM

You're right. With the cdde solution, this product has to be installed on each computer using your DVD.

If autorun.sh is now standard-use (I never tried), then use it, of course.
And you know, many users use automount/supermount these days, or at least a "mount-aware" file-manager, so many don't really know the mount thing.
BTW, opening a "startup HTML hello page" from a autorun.sh script is easy!

Yves.

ilhbutshm 02-10-2005 02:50 AM

Yes, as far as I know, it's a really simple script:
Code:

#!/bin/sh
exec /usr/bin/nautilus index.html

Nice to hear that many use automounting!

Thanks for all the replies!

shockidelica 04-20-2005 10:53 AM

I'm running into a similar issue as you.

I tried creating an autorun.sh file with the sample script you provided (providing my own HTML page, of course). I then burned the CD-ROM with Read and Execute privileges.

When I insert the CD into the drive, it does automount and I am prompted to run the autorun.sh script. However, when I select to run the script or try to execute it through Gnome, the terminal window appears briefly and the closes. It appears as if either the script has not been executed or that the process for the script has been terminated. If I run the script directly from the Terminal, however, it executes as expected.

Does anyone have any ideas what might be happening and what I can do to get it working as desired (i.e. selecting Yes to the autorun prompt actually opens the HTML page in Mozilla)?

I appreciate any help anyone can provide.

Thanks!

System: x86 Running under RedHat 9 w/ kernel 2.4.20-8

:newbie:

shockidelica 04-20-2005 11:07 AM

Just to clarify, I'm substituting Mozilla instead of Nautilus in my case. My script looks like this:

#!/bin/sh
exec /usr/bin/mozilla file:///mnt/cdrom/index.html

Thanks!


All times are GMT -5. The time now is 06:46 AM.