diff options
Diffstat (limited to 'src/sh/isoinfo.sh')
-rw-r--r-- | src/sh/isoinfo.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/sh/isoinfo.sh b/src/sh/isoinfo.sh new file mode 100644 index 0000000..8bcdf35 --- /dev/null +++ b/src/sh/isoinfo.sh @@ -0,0 +1,27 @@ +filename=$2 + +JOLIET=true +ROCK_RIDGE=true + +ISOINFO=`isoinfo -d -i "$filename"` +if echo $ISOINFO | grep "NO Joliet present" >/dev/null 2>&1; then + JOLIET=false +fi +if echo $ISOINFO | grep "NO Rock Ridge present" >/dev/null 2>&1; then + ROCK_RIDGE=false +fi + +iso_extensions="" +if test $ROCK_RIDGE = true; then + iso_extensions="-R" +elif test $JOLIET = true; then + iso_extensions="-J" +fi + +if test "x$3" = x-x; then + file_to_extract=$4 + outfile=$5 + isoinfo $iso_extensions -i "$filename" -x "$file_to_extract" > "$outfile" +else + isoinfo $iso_extensions -i "$filename" -l +fi |