From f307ae290c5fcbe123fde993b4244e1c077d1d69 Mon Sep 17 00:00:00 2001 From: Domingo Dirutigliano Date: Wed, 12 Apr 2023 11:04:37 +0200 Subject: [PATCH] Password input getpass --- start.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/start.py b/start.py index c1aa1c9..8977720 100755 --- a/start.py +++ b/start.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import argparse, sys, platform, os, multiprocessing, subprocess +import argparse, sys, platform, os, multiprocessing, subprocess, getpass pref = "\033[" reset = f"{pref}0m" @@ -92,8 +92,15 @@ if start_operation: if args.psw_no_interactive: psw_set = args.psw_no_interactive elif not args.startup_psw: - puts("Insert the password for firegex: ", end="" , color=colors.yellow, is_bold=True) - psw_set = input() + while True: + puts("Insert the password for firegex: ", end="" , color=colors.yellow, is_bold=True) + psw_set = getpass.getpass("") + puts("Confirm the password: ", end="" , color=colors.yellow, is_bold=True) + check = getpass.getpass("") + if check != psw_set: + puts("Passwords don't match!", end="" , color=colors.yellow, is_bold=True) + else: + break composefile = "firegex-compose.yml"