[Updated] idd.sh: Moved find command to it's own function
This commit is contained in:
parent
522522bf90
commit
6fbb12759c
17
idd.sh
17
idd.sh
@ -29,7 +29,17 @@ Options(){
|
|||||||
|
|
||||||
printf "${BWHITE}[Q]${NC} - Quit\n"
|
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(){
|
CheckFile(){
|
||||||
if [ ! -f "${1}" ];then
|
if [ ! -f "${1}" ];then
|
||||||
printf "${LRED}${1} is not a valid file path${NC}\n"
|
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 "${LGREEN}Image files (img, iso) in ${2}${NC}\n"
|
||||||
printf "${LBLUE}-------------------------------------------${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
|
if [ ! $? = 0 ];then
|
||||||
printf "${LRED}No image files found${NC}\n"
|
printf "${LRED}No image files found${NC}\n"
|
||||||
fi
|
fi
|
||||||
@ -135,7 +146,7 @@ case "$1" in
|
|||||||
printf "${LGREEN}Image files (img, iso) in ${HOMEDIR}${NC}\n"
|
printf "${LGREEN}Image files (img, iso) in ${HOMEDIR}${NC}\n"
|
||||||
printf "${LBLUE}-------------------------------------------${NC}\n"
|
printf "${LBLUE}-------------------------------------------${NC}\n"
|
||||||
|
|
||||||
find ${HOMEDIR} -regex ".*\.\(img\|iso\)" | grep [.iso,.img]
|
FindImages
|
||||||
if [ ! $? = 0 ];then
|
if [ ! $? = 0 ];then
|
||||||
printf "${LRED}No image files found${NC}\n"
|
printf "${LRED}No image files found${NC}\n"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user