MLUG: Re: [MLUG] Autorun on Linux
Re: [MLUG] Autorun on Linux
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Shawn Parker wrote:
> Is there a way to write an "autorun" type file for Linux?  I know that
> when I stick a CD in my Linux laptop it usually autoruns/auto-mounts the
> cd for me...but I'm thinking in terms of hybrid, cross-platform
> cdroms...
> 
> If I develop a cdrom using Flash, I want it to autorun and immediately
> play the app/file...not ask me what to do.
> 
> I know how to do this on both MAC and Win, but I don't know if there is
> a way to do it on Linux?
> 
> Any thoughts?

Here are some sample autorun scripts as provided by RedHat on their 
distribution CDs. I thought they may be helpful to you.

Here's the autorun file from RedHat 7.3 CD:

-----------
#!/bin/sh
#
# Autorun script for Red Hat Linux
# Copyright (c) 1999 Red Hat, Inc.

kwmpid=`/sbin/pidof "kdeinit: kwin"`
kpackage=`/usr/bin/which kpackage` 2> /dev/null
gnorpm=`/usr/bin/which gnorpm-auth` 2> /dev/null

if [ -d /mnt/cdrom ]; then
   cd /mnt/cdrom
fi

if [ "$kwmpid" = "" ]; then
   # they are running GNOME most likely, use gnorpm
   if [ ! "$gnorpm" = "" ]; then
     $gnorpm
   elif [ ! "$kpackage" = "" ]; then
     $kpackage
   fi
else
   if [ ! "$kpackage" = "" ]; then
     $kpackage
   elif [ ! "$gnorpm" = "" ]; then
     $gnorpm
   fi
fi
-----------

Here's the autorun file from RedHat 8.0 CD:

-----------
#!/bin/sh
#
# Autorun script for Red Hat Linux
# Copyright (c) 1999-2002 Red Hat, Inc.

dir=$(echo $0 |sed 's/autorun//')
cd $dir
tree=$(pwd)

# Change directories so we can unmount the CD-ROM Drive
cd /
exec /usr/bin/redhat-cdinstall-helper $tree
-----------

If you don't know what redhat-cdinstall-helper is:

$ file /usr/bin/redhat-cdinstall-helper
/usr/bin/redhat-cdinstall-helper: symbolic link to consolehelper
$ file /usr/bin/consolehelper
/usr/bin/consolehelper: ELF 32-bit LSB executable, Intel 80386, version 
1 (SYSV), dynamically linked (uses shared libs), not stripped
$ rpm -q --whatprovides /usr/bin/consolehelper
usermode-1.63-1

Hope this helps,
--
MK

_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members