kencur,sikencur,aplikasi,tips dan trik, informasi,aplikasi sekolah gratis,pendidikan,aplikasi sekolah,bejalar office

Mount iso file with a shell script

mount-iso-file-with-a-shell-script.png

mount-iso-file-with-a-shell-script.png

So easy to mount many iso file (CD Image) in linux. I’ve done in linux.  And I’m using ubuntu 9.10. This script I use to mount an and many iso files of ubuntu repositiry at one time. Of course this script will be different with your script, according to your address of source iso files and target of destination directory for mounting.
The first step:
Make mountisocdrepo.sh files.

#!/bin/bash
#autor sadam
echo ++++++++++++++++++++++++++++++++++++++++++++++++++

if
echo author : Asep Sudiyono
echo blog   : http://www.chmod.co.cc
echo ++++++++++++++++++++++++++++++++++++++++++++++++++
echo
echo
echo latihan pertama
echo
echo
echo user :
whoami
then
mkdir /winrepo/u904d1/
mkdir /winrepo/u904d2/
mkdir /winrepo/u904d3/
mkdir /winrepo/u904d4/
mkdir /winrepo/u904d5/
mkdir /winrepo/u904d6/
mkdir /winrepo/u904d7/
# command		source	iso			destination
mount -o loop /media/LINUX/ubuntu9.04/u904disk1.iso /winrepo/u904d1/
mount -o loop /media/LINUX/ubuntu9.04/u904disk2.iso /winrepo/u904d2/
mount -o loop /media/LINUX/ubuntu9.04/u904disk3.iso /winrepo/u904d3/
mount -o loop /media/LINUX/ubuntu9.04/u904disk4.iso /winrepo/u904d4/
mount -o loop /media/LINUX/ubuntu9.04/u904disk5.iso /winrepo/u904d5/
mount -o loop /media/LINUX/ubuntu9.04/u904disk6.iso /winrepo/u904d6/
mount -o loop /media/LINUX/ubuntu9.04/tambahan9041-CD1.iso /winrepo/u904d7/
echo #################################################
echo ++++++++++++++++++++++++++++++++++++++++++++++++++
fi
echo done

The second step:
Create the file into executeable mode (chmod + x mountisocdrepo.sh then hit enter).
The third step:
Type “sudo ./mountisocdrepo.sh” in your gnome-terminal then press enter (without quote).

For unmount create use this script:
For example name is umountisocdrepo.sh(Don’t forget to make executeable).

#!/bin/bash
#autor sadam
echo ++++++++++++++++++++++++++++++++++++++++++++++++++

if
echo latihan kedua
whoami

then
umount /winrepo/u904d1/
umount /winrepo/u904d2/
umount /winrepo/u904d3/
umount /winrepo/u904d4/
umount /winrepo/u904d5/
umount /winrepo/u904d6/
umount /winrepo/u904d7/
echo #################################################
echo ++++++++++++++++++++++++++++++++++++++++++++++++++
rm -rf /winrepo/u904d1/
rm -rf /winrepo/u904d2/
rm -rf /winrepo/u904d3/
rm -rf /winrepo/u904d4/
rm -rf /winrepo/u904d5/
rm -rf /winrepo/u904d6/
rm -rf /winrepo/u904d7/
fi
echo done

Just sharing my experience. This may be useful for the new to learn linux. Like me. :-D
Sorry my english is very bad.

Download

Komentar

2 thoughts on “Mount iso file with a shell script”

  1. sasuke_stereobk berkata:

    :2jempol: Master sadam hebat!

  2. alkalaync berkata:

    gracias a Dios por intiresny

Tinggalkan Balasan

Alamat surel Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *