diff --git a/idd.sh b/idd.sh index ca154ed..213d295 100755 --- a/idd.sh +++ b/idd.sh @@ -29,7 +29,17 @@ Options(){ printf "${BWHITE}[Q]${NC} - Quit\n" } - +FindImages(){ + printf "${YELLOW}Searching for image files..${NC}\n" + echo + printf "${LCYAN}Results Found:${NC}\n" + echo + if [ "${1}" ];then + find $1 -regex ".*\.\(img\|iso\)" | grep [.iso,.img] + else + find ${HOMEDIR} -regex ".*\.\(img\|iso\)" | grep [.iso,.img] + fi +} CheckFile(){ if [ ! -f "${1}" ];then printf "${LRED}${1} is not a valid file path${NC}\n" @@ -87,7 +97,8 @@ case "$1" in printf "${LGREEN}Image files (img, iso) in ${2}${NC}\n" printf "${LBLUE}-------------------------------------------${NC}\n" - find $2 -regex ".*\.\(img\|iso\)" | grep [.iso,.img] + #find $2 -regex ".*\.\(img\|iso\)" | grep [.iso,.img] + FindImages $2 if [ ! $? = 0 ];then printf "${LRED}No image files found${NC}\n" fi @@ -135,7 +146,7 @@ case "$1" in printf "${LGREEN}Image files (img, iso) in ${HOMEDIR}${NC}\n" printf "${LBLUE}-------------------------------------------${NC}\n" - find ${HOMEDIR} -regex ".*\.\(img\|iso\)" | grep [.iso,.img] + FindImages if [ ! $? = 0 ];then printf "${LRED}No image files found${NC}\n" fi