Re: bash script stop/continue depending on caddy state.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/8/07, Strong <strong_yethumble@xxxxxxxxx> wrote:
> I have a bash script that works with a cdrom drive. And a have a point
> where the script should automaticly eject the caddy and then wait for
> user to load it with another cd, then the script continues its work.
>
> I realised it by eject command to unload caddy, then wait for a key hit
> with 'read' then it 'eject -t' to close the caddy then the script
> continues.
>
> What I want is to remove the key hitting but replace it with caddy load
> instead - just script stops when the caddy has been ejected and
> continues after caddy has been closed (with the help of an user).
>
> Any suggestions?

I'd be interested in seeing that part of the script (the eject).  I
have never played with that command.  Is it a bash command or an
external command?

Regards how to detect the caddy being loaded, I haven't tested but
someone else may have.  Are there any logs that get populated when you
load a CD into a caddy?  If so your script could monitor that log
using a loop of sorts (perhaps with a pause in the loop so it's not
chewing up too many cycles).  When the appropriate log activity is
noted the script breaks out of the loop.  I'd include a safeguard such
as a counter in the loop that if Max_Count was reached to exit the
loop and prompt the user to select either Abort or OK depending on if
they wished to abort the script, or that OK the CD is loaded but was
not detected (or not loaded in the initial delay period set in the
loop).

Jacques B.

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux