mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2025-02-21 16:45:11 +00:00
Allow 'y', 'yes', and case-insensitive variants for confirmation
This commit is contained in:
parent
6dc4502825
commit
4e09e5a8d6
|
@ -170,7 +170,8 @@ write_iso(){
|
||||||
printf "%b" "${RED}WARNING: This will erase all data on ${USB_DEVICE}. Are you sure you want to continue? (y/N): ${RC}"
|
printf "%b" "${RED}WARNING: This will erase all data on ${USB_DEVICE}. Are you sure you want to continue? (y/N): ${RC}"
|
||||||
read -r CONFIRMATION
|
read -r CONFIRMATION
|
||||||
|
|
||||||
if [ "$CONFIRMATION" != "yes" ]; then
|
# Convert the input to lowercase and compare
|
||||||
|
if [ "$(echo "$CONFIRMATION" | tr '[:upper:]' '[:lower:]')" != "yes" ] && [ "$(echo "$CONFIRMATION" | tr '[:upper:]' '[:lower:]')" != "y" ]; then
|
||||||
printf "%b\n" "${YELLOW}Operation cancelled.${RC}"
|
printf "%b\n" "${YELLOW}Operation cancelled.${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -204,4 +205,4 @@ write_iso(){
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
write_iso
|
write_iso
|
||||||
|
|
Loading…
Reference in New Issue
Block a user