check for existance of the file(1) utility;
might not be found in lean chroots
This commit is contained in:
parent
9eb2097e01
commit
07b5eb1323
@ -81,10 +81,17 @@ ln "$on_disk"/file_2 "$on_disk"/file_2_link_a || exit 1
|
|||||||
# trivial ISO 9660 image validation routine
|
# trivial ISO 9660 image validation routine
|
||||||
is_valid_iso9660() {
|
is_valid_iso9660() {
|
||||||
ISOfile="$1"
|
ISOfile="$1"
|
||||||
|
if ! which file >/dev/null 2>&1; then
|
||||||
|
printf "\nFAIL : ${SELF}: Not found: file. Please install the file(1) utility.\n"
|
||||||
|
failure=1
|
||||||
|
return
|
||||||
|
fi
|
||||||
if [ ! -f ${ISOfile} ]; then
|
if [ ! -f ${ISOfile} ]; then
|
||||||
failure=1
|
failure=1
|
||||||
printf "\nFAIL : ${SELF} : Not found: ${ISOfile}\n"
|
printf "\nFAIL : ${SELF} : Not found: ${ISOfile}\n"
|
||||||
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
file ${ISOfile}
|
file ${ISOfile}
|
||||||
if file ${ISOfile} | grep "ISO *9660" >/dev/null 2>&1; then
|
if file ${ISOfile} | grep "ISO *9660" >/dev/null 2>&1; then
|
||||||
printf "\n${SELF}: Resulting ${ISOfile} OK. Looks like ISO 9660 filesystem.\n"
|
printf "\n${SELF}: Resulting ${ISOfile} OK. Looks like ISO 9660 filesystem.\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user