Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Mar 2011 12:11:30 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        Ryan Coleman <editor@d3photography.com>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: Automating mounting of ISO images
Message-ID:  <31D3BED1-7035-435F-B127-EFAAF6AFF076@mac.com>
In-Reply-To: <21012F71-5038-45F1-98C6-72A0B1239009@d3photography.com>
References:  <21012F71-5038-45F1-98C6-72A0B1239009@d3photography.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi--

On Mar 23, 2011, at 11:49 AM, Ryan Coleman wrote:
> Disc images are located in /mount/disc_images/ (all are ISOs)
> They need to mount into /mount/office_files/images/FILENAME [without the .iso extension]
> 
> How can I do this? I've always been given these types of scripts in the past at an old job but I don't have access to those examples anymore.

Something like this might do (untested, though):

#! /bin/sh                                                                                                  

for FILE in /mount/disc_images/*; do
   DEST=$FILE:r
   mount -t cd9660 /dev/`mdconfig -f ${FILE}` /mount/office_files/images/${DEST}
done

Might need to add quotes if you have spaces or other unusual characters in your ISO filenames....

Regards,
-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31D3BED1-7035-435F-B127-EFAAF6AFF076>