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

Notices


Reply
  Search this Thread
Old 11-04-2003, 11:21 AM   #1
Panzerfrost
Member
 
Registered: Aug 2003
Distribution: RedHat 9, Mandrake 9.1, Slackware 9.1
Posts: 81

Rep: Reputation: 15
Importing a script?


Hello. I have seen a template for a script which is supposed to mount a CD if not mounted, and eject it if it is mounted.

Code:
#!/bin/sh
# script to mount/umount cdrom
# for use with xfce4-trigger-launcher
if [ "$1" = "1" ]; then
    mount /cdwriter &> /dev/null
elif [ "$1" = "0" ]; then
    eject /cdwriter &> /dev/null
else
    STATUS=`grep cdwriter /proc/mounts` 
    if [ "x$STATUS" = "x" ]; then
        echo 0
    else
        echo 1
    fi
fi
My question is how do I make this script work for my own system.

Here's the relevant fstab line:
Code:
/dev/cdrom       /mnt/cdrom       iso9660     noauto,owner,ro  0   0
Also, mounting a cd as a normal user does not work, can anyone tell me how I can enable mounting for a normal user?


Thanks in advance for your replies.
 
Old 11-04-2003, 11:37 AM   #2
jkobrien
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507

Rep: Reputation: 30
Check out the documentation for /etc/fstab (man fstab). As far as I remember if you change "owner" to "user" anyone can mount your cdrom.

As for the script, it looks like it's taking an argument ($1) from another script or program that calls it (presumably xfce4-trigger-launcher ?). If you really want to use it, try changing "/cdwriter" to "/mnt/cdrom" and then type "<script_name> 1" to mount and "<script_name> 0" to eject the disc. Not sure if that gains you much though.

John

Last edited by jkobrien; 11-05-2003 at 08:48 AM.
 
  


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
need help with importing subtitles vegetassj2 Linux - Software 2 08-09-2005 12:00 PM
Importing a package Birgi Programming 4 03-17-2005 03:47 PM
Importing IE e-mails Rutnut Linux - General 5 05-29-2004 08:35 AM
importing??? mojozoox Linux - Software 3 08-25-2003 07:43 AM
Importing Favorites TX_metalhead Linux - General 0 01-23-2002 09:32 AM

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

All times are GMT -5. The time now is 09:38 PM.

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