From d27e1caf5f82e7ff9e81e9396dcf787c56f7d338 Mon Sep 17 00:00:00 2001 From: The-Plottwist Date: Sat, 15 Jan 2022 20:55:37 +0300 Subject: [PATCH] Little fixes Almost always ```read``` command should be used with ```-r``` option. Added some clarity about globals. --- install.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index e7e09b5..6e4a684 100755 --- a/install.sh +++ b/install.sh @@ -29,8 +29,6 @@ b_CWAR=" \033[1;33m" # bold warning color # ──────────────────────────────────────────────────────────────── # -[ GLOBAL::CONF ] -{ readonly ROOT_UID=0 readonly Project_Name="GRUB2::THEMES" readonly MAX_DELAY=20 # max delay for user to enter root password @@ -38,7 +36,6 @@ tui_root_login= THEME_DIR="/usr/share/grub/themes" REO_DIR="$(cd $(dirname $0) && pwd)" -} THEME_VARIANTS=('tela' 'vimix' 'stylish' 'whitesur') ICON_VARIANTS=('color' 'white' 'whitesur') @@ -225,7 +222,7 @@ install() { else prompt -e "\n [ Error! ] -> Run me as root! " - read -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s + read -r -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s if sudo -S echo <<< $REPLY 2> /dev/null && echo; then @@ -408,7 +405,7 @@ remove() { else #Ask for password prompt -e "\n [ Error! ] -> Run me as root! " - read -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s + read -r -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s #when using "read" command, "-r" option must be supplied ==> https://github.com/koalaman/shellcheck/wiki/SC2162 if sudo -S echo <<< $REPLY 2> /dev/null && echo; then #Correct password, use with sudo's stdin @@ -435,7 +432,7 @@ dialog_installer() { else #Ask for password prompt -e "\n [ Error! ] -> Run me as root! " - read -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s + read -r -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s if sudo -S echo <<< $REPLY 2> /dev/null && echo; then #Correct password, use with sudo's stdin