LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy
User Name
Password
Puppy This forum is for the discussion of Puppy Linux.

Notices


Reply
  Search this Thread
Old 07-29-2015, 08:25 AM   #16
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,142
Blog Entries: 21

Rep: Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480

Rox Desktop Icons on a JWM window manager auto mounting a icon for a text editor? Or auto mounting a icon period for a cd disk inserted and running?

http://www.murga-linux.com/puppy/viewtopic.php?t=50845
 
Old 07-29-2015, 08:27 AM   #17
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,142
Blog Entries: 21

Rep: Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480
Quote:
Then it should mount OK this must be a puppy linux thing, which I can't help you with, its probably just a permissions thing, you may need to add yourself to a specific group to be able to mount cdroms eg group 'cdrom'.
Try mounting it manually and see what happens.
Puppy is a single user system by default and runs as root unless spot or fido is used to launch applications as a user.
Non of that maybe applies in this thread as nothing mentioned as running as user spot or fido.
 
Old 07-29-2015, 08:46 AM   #18
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
This works.

But how can I have a script check for 'no disk' and perform an action based on that info ?

Quote:
# cddetect_quick -d/dev/sr0
no disc
 
Old 07-29-2015, 08:53 AM   #19
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,749

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
Something like

Code:
  cd_chk=$( cddetect_quick -d /dev/sr0 )
  if [[ $cd_chk == "no disc" ]]; then
     do something here
  fi
 
Old 07-29-2015, 09:18 AM   #20
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Thanks.

This works except for the thunar line.

The CD drive is mounted but no files are shown in /mnt/sr0.

Quote:
cd_chk=$( cddetect_quick -d /dev/sr0 )

if [[ $cd_chk == "no disc" ]]; then
echo "No CD/DVD in drive !!"
exit
fi

if [[ $cd_chk == "disc inserted" ]]; then
echo "CD/DVD is in drive."
thunar /mnt/sr0/
fi
 
Old 07-29-2015, 09:40 AM   #21
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,749

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
Not sure I understand, thunar is not opening a new window /mnt/sr0 or it is and your not seeing any files?

According to the man page the URI is specified with file: i.e.

thunar file:/mnt/sr0
 
Old 07-29-2015, 09:50 AM   #22
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I tried thunar file:/mnt/sr0 and it also did not show any files.

I will see if Rox Filer command will show the files.

rox /mnt/sr0/ does not show any files either.

Last edited by Fixit7; 07-29-2015 at 09:54 AM.
 
Old 07-29-2015, 10:07 AM   #23
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,749

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
Are you sure the disc is mounted?
 
Old 07-29-2015, 01:19 PM   #24
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
My final version.

Quote:
#!/bin/bash
# Display content of CD or DVD
#
# Linux Puppy 5.9.3
# SiegeWorks 2015 A.P.K.
#
# Help from rcrsn51,Flash,michaelk,01micko,
#
cd_chk=$( cddetect_quick -d /dev/sr0 )

if [[ $cd_chk == "no disc" ]]; then
echo "No CD/DVD in drive !!"
gxmessage -timeout 2 "No CD/DVD in drive !!"
exit
fi

if [[ $cd_chk == "disc inserted" ]]; then
echo "CD/DVD is in drive."
mkdir -p /mnt/sr0
mount -t iso9660 /dev/sr0 /mnt/sr0
thunar /mnt/sr0/
fi
 
  


Reply



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
DVD integrity check? protorox Linux - Software 3 04-02-2014 11:13 AM
How to check whether a bootable DVD is damaged or not ? Aquarius_Girl Linux - General 15 07-13-2010 08:27 AM
Slow USB DVD writes what do i check. Spirals Linux - Hardware 4 12-07-2009 03:41 PM
How to check whether there's a CD / DVD mounted in C++? g4j31a5 Programming 1 05-29-2007 04:45 AM
Can somebody check my dvd filesystem layout? Inexactitude Linux - Software 3 03-06-2004 11:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy

All times are GMT -5. The time now is 09:22 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration