Options:
-i <input dev> Defaults to ${dev}
-o <output dir> Defaults to ${out}
+ -n <volume name> Defaults to volume on disk
EOF
exit ${1:-0}
}
dev=/dev/cdrom
out=${PWD}
+vol=
-eval set -- `getopt -- hi:o: "$@"`
+eval set -- `getopt -- hi:n:o: "$@"`
while [[ -n $1 ]] ; do
case $1 in
-h) usage;;
-i) dev=$2; shift 2;;
-o) out=$2; shift 2;;
+ -n) vol=$2; shift 2;;
--) shift; break;;
-*) usage 1;;
*) usage 2; break;;
Preparer= # -p
Publisher= # -publisher
System= # -sysid
-Volume= # -V
+Volume=${vol} # -V
Volume_Set= # -volset
-info=$(iso-info ${dev}) || exit 1
+if [[ -z ${Volume} ]] ; then
+ info=$(iso-info ${dev}) || exit 1
-eval $(echo "${info}" | awk -F: '
- (NF > 1 && $1 !~ /image/) {
- sub(/ *$/, "", $1);
- sub(/ /, "_", $1);
- sub(/^ */, "", $2);
- print $1 "=\"" $2 "\"";
-}')
+ eval $(echo "${info}" | awk -F: '
+ (NF > 1 && $1 !~ /image/) {
+ sub(/ *$/, "", $1);
+ sub(/ /, "_", $1);
+ sub(/^ */, "", $2);
+ print $1 "=\"" $2 "\"";
+ }')
+fi
if [[ -z ${Volume} ]] ; then
echo "Unable to parse Volume out of ISO"
echo
"$@"
}
-e dvdbackup -M -i ${dev} -o "${out}"
+e dvdbackup -M -i ${dev} -o "${out}" -n "${Volume}"
e mkisofs -quiet -dvd-video \
-A "${Application}" \
-p "${Preparer}" \