#!/bin/bash
# Steven Shiau <steven@nchc.org.tw>
# License: GPL

# Load DRBL setting and functions
if [ ! -f "/opt/drbl/sbin/drbl-conf-functions" ]; then
  echo "Unable to find /opt/drbl/sbin/drbl-conf-functions! Program terminated!" 
  exit 1
fi
. /opt/drbl/sbin/drbl-conf-functions

#
check_if_root

iso_img=$1
ver_no=$2

USAGE="Usage: $0 iso_image_file version"

if [ $# -ne 2 ]; then
  echo "$USAGE"
  echo "Example: If you run $0 like this:"
  echo "$0 rh9_drbl.iso 9"
  echo "It will mount the rh9_drbl.iso to /opt/apt/redhat/9/en/i386"
  exit 1
fi
if [ ! -d /opt/apt/redhat/$ver_no/en ]; then
     mkdir -p /opt/apt/redhat/$ver_no/en/i386
fi
mount -t iso9660 -o loop $iso_img /opt/apt/redhat/$ver_no/en/i386
