1
0
mirror of https://github.com/morrownr/8821cu-20210916.git synced 2024-09-28 11:57:30 +00:00

Use printf and case around the read statements to make the prompts a bit friendlier

This commit is contained in:
Miles Goodhew 2023-01-26 01:33:34 +11:00
parent c0281e1d05
commit 53e8b12bcb
3 changed files with 16 additions and 16 deletions

View File

@ -52,11 +52,11 @@ echo ": ${SCRIPT_NAME} v${SCRIPT_VERSION}"
${TEXT_EDITOR} /etc/modprobe.d/${OPTIONS_FILE} ${TEXT_EDITOR} /etc/modprobe.d/${OPTIONS_FILE}
echo "Do you want to apply the new options by rebooting now? [y/N] " printf "Do you want to apply the new options by rebooting now? [y/N] "
read -r REPLY read -r REPLY
echo # move to a new line echo # move to a new line
if [ "${REPLY}" = y ] || [ "${REPLY}" = Y ]; then case "$REPLY" in
reboot [yY]*) reboot ;;
fi esac
exit 0 exit 0

View File

@ -342,19 +342,19 @@ fi
# if NoPrompt is not used, ask user some questions # if NoPrompt is not used, ask user some questions
if [ $NO_PROMPT -ne 1 ]; then if [ $NO_PROMPT -ne 1 ]; then
echo "Do you want to edit the driver options file now? [y/N]" printf "Do you want to edit the driver options file now? [y/N] "
read -r REPLY read -r REPLY
echo echo
if [ "$REPLY" = y ] || [ "$REPLY" = Y ]; then case "$REPLY" in
${TEXT_EDITOR} /etc/modprobe.d/${OPTIONS_FILE} [yY]*) ${TEXT_EDITOR} /etc/modprobe.d/${OPTIONS_FILE} ;;
fi esac
echo "Do you want to reboot now? (recommended) [y/N]" printf "Do you want to reboot now? (recommended) [y/N] "
read -r REPLY read -r REPLY
echo echo
if [ "$REPLY" = y ] || [ "$REPLY" = Y ]; then case "$REPLY" in
reboot [yY]*) reboot ;;
fi esac
fi fi
exit 0 exit 0

View File

@ -129,12 +129,12 @@ echo "You may now delete the driver directory if desired."
# if NoPrompt is not used, ask user some questions # if NoPrompt is not used, ask user some questions
if [ $NO_PROMPT -ne 1 ]; then if [ $NO_PROMPT -ne 1 ]; then
echo "Do you want to reboot now? (recommended) [y/N]" printf "Do you want to reboot now? (recommended) [y/N] "
read -r REPLY read -r REPLY
echo echo
if [ "$REPLY" = y ] || [ "$REPLY" = Y ]; then case "$REPLY" in
reboot [yY]*) reboot ;;
fi esac
fi fi
exit 0 exit 0