[Updated] idd.sh: Added Quit option

This commit is contained in:
mollusk 2016-07-06 13:52:27 -07:00
parent 93bfc7d815
commit 9a24aee7fa

34
idd.sh
View File

@ -17,6 +17,7 @@ CYAN="\033[0;36m"
LCYAN="\033[1;36m"
PURPLE="\033[0;35m"
LPURPLE="\033[1;35m"
BWHITE="\e[1m"
NC='\033[0m' # No Color
if [[ $EUID -ne 0 ]]; then
@ -24,13 +25,32 @@ if [[ $EUID -ne 0 ]]; then
exit 1
fi
Options(){
printf "${BWHITE}[Q]${NC} - Quit\n"
}
Quit(){
if [ "${1}" = "q" ];then
echo
printf "${LRED}Exiting......${NC}\n"
echo
exit 0;
elif [ "${1}" = "Q" ];then
echo
printf "${LRED}Exiting......${NC}\n"
echo
exit 0;
fi
}
case "$1" in
-d) if [ -f /usr/bin/pv ];then
clear
printf "${LCYAN}idd - interactive dd${NC}\n"
printf "${LPURPLE}********************************${NC}\n"
Options
echo
printf "${LGREEN}Image files (img, iso) in ${2}${NC}\n"
printf "${LBLUE}-------------------------------------------${NC}\n"
@ -43,8 +63,10 @@ case "$1" in
printf "${YELLOW}Copy & paste full file path here: ${NC}"
read filepath
Quit ${filepath}
clear
Options
echo
printf "${LGREEN}List of DEVICES in ${DEVICEDIR}/${NC}\n"
printf "${LBLUE}-------------------------------------------${NC}\n"
lsblk
@ -52,6 +74,7 @@ case "$1" in
echo
printf "${YELLOW}Enter name of device${NC} (${LCYAN}example${NC}, ${LBLUE}sdb${NC}): "
read devname
Quit ${devname}
echo
@ -70,9 +93,9 @@ case "$1" in
;;
*) if [ -f /usr/bin/pv ];then
clear
printf "${LCYAN}idd - interactive dd${NC}\n"
printf "${LPURPLE}********************************${NC}\n"
Options
echo
printf "${LGREEN}Image files (img, iso) in ${HOMEDIR}${NC}\n"
printf "${LBLUE}-------------------------------------------${NC}\n"
@ -87,7 +110,11 @@ case "$1" in
printf "${YELLOW}Copy & paste full file path here: ${NC}"
read filepath
Quit ${filepath}
clear
Options
echo
printf "${LGREEN}List of DEVICES in ${DEVICEDIR}/${NC}\n"
printf "${LBLUE}-------------------------------------------${NC}\n"
lsblk
@ -95,6 +122,7 @@ case "$1" in
echo
printf "${YELLOW}Enter name of device${NC} (${LCYAN}example${NC}, ${LBLUE}sdb${NC}): "
read devname
Quit ${devname}
echo