Results 1 to 3 of 3

Thread: Linux Shell Script to make CD/DVD Image mounting possible

  1. #1
    Join Date
    Apr 2008
    Posts
    2,005

    Linux Shell Script to make CD/DVD Image mounting possible

    Mounting Of CD/DVD images are hectic and complex command based. To make it simple here is a way :

    Copy the Following code in a text editor and save it as mount.sh


    Mount Script

    Code:
    #!/bin/bash
    # mount
    
    gksudo -k /bin/echo "Are You  The Admin?"
    
    BASENAME=`basename $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS .iso`
    
    sudo mkdir "/media/$BASENAME"
    
    zenity --info --title "ISO Mounter" --text "$BASENAME e $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
    
    
    if sudo mount -o loop -t iso9660 $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS "/media/$BASENAME"
    then
    if zenity --question --title "ISO Mounter" --text "$BASENAME Successfully Mounted. Open Volume?"
    
    then
    nautilus /media/"$BASENAME" --no-desktop
    fi
    
    exit 0
    else
    sudo rmdir "/media/$BASENAME"
    
    zenity --error --title "ISO Mounter" --text "Cannot mount $BASENAME!"
    
    exit 1
    fi

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Linux Shell Script to make CD/DVD Image mounting possible

    Copy the Following code in a text editor and save it as unmount.sh

    Unmount Script

    Code:
    #!/bin/bash
    # unmount
    
    gksudo -k /bin/echo "Are You  The Admin?"
    
    BASENAME=`basename $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS .iso`
    
    sudo umount "/media/$BASENAME"
    
    sudo rmdir "/media/$BASENAME"
    
    zenity --info --text "Successfully unmounted /media/$BASENAME"
    
    exit 0

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Linux Shell Script to make CD/DVD Image mounting possible

    These codes are NAUTILUS SCRIPTS.

    Now you need to change the permission of the mount.sh and unmount.sh files : Type in the following commands in terminal : One line at a time!

    Code:
    sudo chmod +x /home/username/Desktop/mount.sh
    sudo chmod +x /home/username/Desktop/umount.sh
    Now you need to copy them to actual nautilus scripts.

    Code:
    sudo mv /home/username/mount.sh ~/.gnome2/nautilus-scripts/
    sudo mv /home/username/unmount.sh ~/.gnome2/nautilus-scripts/
    Now Reboot you computer to see the change...

    To check Right click on any CD/DVD image there will be two options :
    • Mount
    • Unmount


    Now mounting will be easy...! Just Right Click the image and select the action.

Similar Threads

  1. Want to make MP3/IMAGE videos for YouTube on Linux
    By Hadassah in forum Windows Software
    Replies: 4
    Last Post: 13-01-2011, 02:36 AM
  2. Linux shell script to find duplicate images
    By Savious in forum Operating Systems
    Replies: 6
    Last Post: 21-10-2010, 05:26 AM
  3. Shell script with sed
    By Ameeryan in forum Software Development
    Replies: 5
    Last Post: 23-12-2009, 02:29 PM
  4. Image Mounting/Virtual Drive software
    By Kusagra in forum Operating Systems
    Replies: 3
    Last Post: 10-08-2009, 01:55 PM
  5. Problem of shell script on Linux
    By $tatic in forum Software Development
    Replies: 4
    Last Post: 16-04-2009, 09:08 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,003,953.90421 seconds with 16 queries