mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-12-23 20:09:44 +00:00
Remove bashisms from disable monitor (#472)
Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>
This commit is contained in:
parent
719548f971
commit
e78351244a
|
@ -20,7 +20,8 @@ disable_monitor() {
|
|||
i=$((i + 1))
|
||||
done
|
||||
|
||||
read -p "Enter the number of the monitor: " monitor_choice
|
||||
printf "%b\n" "Enter the number of the monitor: "
|
||||
read -r monitor_choice
|
||||
|
||||
if ! echo "$monitor_choice" | grep -qE '^[0-9]+$' || [ "$monitor_choice" -lt 1 ] || [ "$monitor_choice" -gt "$((i - 1))" ]; then
|
||||
printf "%b\n" "${RED}Invalid selection.${RC}"
|
||||
|
@ -44,7 +45,8 @@ disable_monitor() {
|
|||
confirm_action() {
|
||||
action="$1"
|
||||
printf "%b\n" "${YELLOW}$action${RC}"
|
||||
read -p "Are you sure? (y/n): " confirm
|
||||
printf "%b\n" "Are you sure? (y/n): "
|
||||
read -r confirm
|
||||
if echo "$confirm" | grep -qE '^[Yy]$'; then
|
||||
return 0
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user