From 108c8e34cdcd6e929aa7266bbd55bf3f8c10acfb Mon Sep 17 00:00:00 2001
From: Santiago Lo Coco <santilococo.01@gmail.com>
Date: Wed, 19 Jan 2022 18:14:37 -0300
Subject: [PATCH] Add support for passwordbox

---
 scripts/common.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/common.sh b/scripts/common.sh
index 8f9eae6..3218047 100755
--- a/scripts/common.sh
+++ b/scripts/common.sh
@@ -92,12 +92,13 @@ useWhiptail() {
 }
 
 usePlainText() {
-    inputbox=false; infobox=false; yesno=false
+    inputbox=false; infobox=false; passwordbox=false; yesno=false
     for item in "$@"; do
         case $item in
             --title) shift && shift ;;
             --inputbox) inputbox=true ;;
             --infobox) infobox=true ;;
+            --passwordbox) passwordbox=true ;;
             --yesno) yesno=true ;;
         esac
     done
@@ -105,6 +106,9 @@ usePlainText() {
     if [ $inputbox = true ]; then
         read -r readVar
         printf "$readVar" 1>&2
+    elif [ $passwordbox = true ]; then
+        read -r -s readVar
+        printf "$readVar" 1>&2
     elif [ $yesno = true ]; then
         printf "[y/n] "
         read -n 1 -r readVar