[Updated] idd.sh: Added Quit option
This commit is contained in:
parent
93bfc7d815
commit
9a24aee7fa
34
idd.sh
34
idd.sh
@ -17,6 +17,7 @@ CYAN="\033[0;36m"
|
|||||||
LCYAN="\033[1;36m"
|
LCYAN="\033[1;36m"
|
||||||
PURPLE="\033[0;35m"
|
PURPLE="\033[0;35m"
|
||||||
LPURPLE="\033[1;35m"
|
LPURPLE="\033[1;35m"
|
||||||
|
BWHITE="\e[1m"
|
||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
@ -24,13 +25,32 @@ if [[ $EUID -ne 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
case "$1" in
|
||||||
|
|
||||||
-d) if [ -f /usr/bin/pv ];then
|
-d) if [ -f /usr/bin/pv ];then
|
||||||
clear
|
clear
|
||||||
|
|
||||||
printf "${LCYAN}idd - interactive dd${NC}\n"
|
printf "${LCYAN}idd - interactive dd${NC}\n"
|
||||||
printf "${LPURPLE}********************************${NC}\n"
|
printf "${LPURPLE}********************************${NC}\n"
|
||||||
|
Options
|
||||||
echo
|
echo
|
||||||
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"
|
||||||
@ -43,8 +63,10 @@ case "$1" in
|
|||||||
|
|
||||||
printf "${YELLOW}Copy & paste full file path here: ${NC}"
|
printf "${YELLOW}Copy & paste full file path here: ${NC}"
|
||||||
read filepath
|
read filepath
|
||||||
|
Quit ${filepath}
|
||||||
clear
|
clear
|
||||||
|
Options
|
||||||
|
echo
|
||||||
printf "${LGREEN}List of DEVICES in ${DEVICEDIR}/${NC}\n"
|
printf "${LGREEN}List of DEVICES in ${DEVICEDIR}/${NC}\n"
|
||||||
printf "${LBLUE}-------------------------------------------${NC}\n"
|
printf "${LBLUE}-------------------------------------------${NC}\n"
|
||||||
lsblk
|
lsblk
|
||||||
@ -52,6 +74,7 @@ case "$1" in
|
|||||||
echo
|
echo
|
||||||
printf "${YELLOW}Enter name of device${NC} (${LCYAN}example${NC}, ${LBLUE}sdb${NC}): "
|
printf "${YELLOW}Enter name of device${NC} (${LCYAN}example${NC}, ${LBLUE}sdb${NC}): "
|
||||||
read devname
|
read devname
|
||||||
|
Quit ${devname}
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
@ -70,9 +93,9 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
*) if [ -f /usr/bin/pv ];then
|
*) if [ -f /usr/bin/pv ];then
|
||||||
clear
|
clear
|
||||||
|
|
||||||
printf "${LCYAN}idd - interactive dd${NC}\n"
|
printf "${LCYAN}idd - interactive dd${NC}\n"
|
||||||
printf "${LPURPLE}********************************${NC}\n"
|
printf "${LPURPLE}********************************${NC}\n"
|
||||||
|
Options
|
||||||
echo
|
echo
|
||||||
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"
|
||||||
@ -87,7 +110,11 @@ case "$1" in
|
|||||||
printf "${YELLOW}Copy & paste full file path here: ${NC}"
|
printf "${YELLOW}Copy & paste full file path here: ${NC}"
|
||||||
read filepath
|
read filepath
|
||||||
|
|
||||||
|
Quit ${filepath}
|
||||||
|
|
||||||
clear
|
clear
|
||||||
|
Options
|
||||||
|
echo
|
||||||
printf "${LGREEN}List of DEVICES in ${DEVICEDIR}/${NC}\n"
|
printf "${LGREEN}List of DEVICES in ${DEVICEDIR}/${NC}\n"
|
||||||
printf "${LBLUE}-------------------------------------------${NC}\n"
|
printf "${LBLUE}-------------------------------------------${NC}\n"
|
||||||
lsblk
|
lsblk
|
||||||
@ -95,6 +122,7 @@ case "$1" in
|
|||||||
echo
|
echo
|
||||||
printf "${YELLOW}Enter name of device${NC} (${LCYAN}example${NC}, ${LBLUE}sdb${NC}): "
|
printf "${YELLOW}Enter name of device${NC} (${LCYAN}example${NC}, ${LBLUE}sdb${NC}): "
|
||||||
read devname
|
read devname
|
||||||
|
Quit ${devname}
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user