diff options
-rwxr-xr-x | scripts/boot/9990-misc-helpers.sh | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/scripts/boot/9990-misc-helpers.sh b/scripts/boot/9990-misc-helpers.sh index 8d7943e..40e69be 100755 --- a/scripts/boot/9990-misc-helpers.sh +++ b/scripts/boot/9990-misc-helpers.sh @@ -2,21 +2,21 @@ #set -e -is_live_path () +file_pattern_matches() { - DIRECTORY="${1}" - - if [ -d "${DIRECTORY}"/"${LIVE_MEDIA_PATH}" ] - then - for FILESYSTEM in squashfs ext2 ext3 ext4 xfs dir jffs2 - do - if [ -e "${DIRECTORY}/${LIVE_MEDIA_PATH}/"*".${FILESYSTEM}" ] - then - return 0 - fi - done - fi + [ -e "$1" ] +} +is_live_path() +{ + DIRECTORY="${1}/${LIVE_MEDIA_PATH}" + for FILESYSTEM in squashfs ext2 ext3 ext4 xfs dir jffs + do + if file_pattern_matches "${DIRECTORY}/"*.${FILESYSTEM} + then + return 0 + fi + done return 1 } |