From 5fdacf5b34e203188c2cffd08437b3c49cb5de10 Mon Sep 17 00:00:00 2001 From: Eduard Veit Date: Mon, 20 Feb 2023 15:37:59 +0100 Subject: [PATCH] minor: make password input invisible --- gitea-installer.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gitea-installer.sh b/gitea-installer.sh index bd7712f..f67d53c 100644 --- a/gitea-installer.sh +++ b/gitea-installer.sh @@ -22,7 +22,12 @@ function install_gitea echo "Installing $APP_NAME $LATEST_VERSION" echo "Please set your $APP_NAME login credentials." read -r -p "$APP_NAME admin user: " ADMIN_USER - read -r -p "$APP_NAME admin password: " ADMIN_PASS + ask_for_password + while [ -z "$ADMIN_PASS" ] || [ "$ADMIN_PASS" != "$ADMIN_PASS_CONFIRMATION" ] + do + echo That was not correct, try again + ask_for_password + done wget --quiet --progress=bar:force --output-document "$TMP_LOCATION"/gitea "$DOWNLOAD_URL" verify_file mkdir --parents ~/gitea/custom/conf/ @@ -53,7 +58,7 @@ function install_gitea install_update_script echo "This is the file structure for this app" echo_tree - printf "You can now access your $APP_NAME by directing you Browser to: \n https://%s.uber.space \n" "$USER" + printf "You can now access your $APP_NAME by directing you browser to: \n https://%s.uber.space \n" "$USER" } function uninstall_gitea @@ -75,6 +80,15 @@ function uninstall_gitea set_critical_section } +function ask_for_password +{ + echo "Your password input will not be visible." + read -s -r -p "$APP_NAME admin password: " ADMIN_PASS + echo + read -s -r -p "$APP_NAME admin password confirmation: " ADMIN_PASS_CONFIRMATION + echo +} + # This is only relevant for the uninstaller for broken old installations function fix_stop_signal {