LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-09-2005, 04:39 AM   #1
ilhbutshm
Member
 
Registered: Jul 2003
Location: Europe
Distribution: Slackware 10.2
Posts: 104

Rep: Reputation: 15
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?
 
Old 02-09-2005, 08:36 AM   #2
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
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).
 
Old 02-09-2005, 09:37 AM   #3
ilhbutshm
Member
 
Registered: Jul 2003
Location: Europe
Distribution: Slackware 10.2
Posts: 104

Original Poster
Rep: Reputation: 15
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.
 
Old 02-09-2005, 10:29 AM   #4
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
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.
 
Old 02-09-2005, 11:29 AM   #5
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
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.
 
Old 02-09-2005, 12:29 PM   #6
enigmasoldier
Member
 
Registered: Jul 2003
Location: Florence, Ky
Distribution: CentOS 3.3-4, OpenBSD 3.3, Fedora Core 4, Ubuntu, Novell Open Enterprise Server
Posts: 213

Rep: Reputation: 30
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.
 
Old 02-09-2005, 02:03 PM   #7
ilhbutshm
Member
 
Registered: Jul 2003
Location: Europe
Distribution: Slackware 10.2
Posts: 104

Original Poster
Rep: Reputation: 15
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.
 
Old 02-10-2005, 02:37 AM   #8
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
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.
 
Old 02-10-2005, 02:50 AM   #9
ilhbutshm
Member
 
Registered: Jul 2003
Location: Europe
Distribution: Slackware 10.2
Posts: 104

Original Poster
Rep: Reputation: 15
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!
 
Old 04-20-2005, 10:53 AM   #10
shockidelica
LQ Newbie
 
Registered: Apr 2005
Posts: 2

Rep: Reputation: 0
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

 
Old 04-20-2005, 11:07 AM   #11
shockidelica
LQ Newbie
 
Registered: Apr 2005
Posts: 2

Rep: Reputation: 0
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
inserting html into html NeptunEz Programming 2 12-19-2004 07:18 AM
Konqueror + file:/usr/share/doc/HTML/index.html jon_k Linux - Software 2 11-25-2003 05:06 AM
auto run applications (eg Mplayer when inserting a DVD) tristure Linux - Software 0 10-26-2003 04:51 PM
inserting text into a file DavidPhillips Programming 5 08-15-2003 04:53 PM
Autorun.sh script to mount CD and run .bin file kulkarni08 Linux - General 2 06-24-2003 01:01 PM


All times are GMT -5. The time now is 04:47 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration