From 0ee9284606fbb600aa05eb5d7a2425bbab5a4855 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Sat, 5 Dec 2020 20:41:00 +0100 Subject: setup2hd: major changes - use $DIALOG instead of calling dialog; hopefully we can use Xdialog at some time - warn user if terminal is too small to display fdisk/gdisk interfaces - improve installation time of squashfs modules to harddisk with a factor 6, by using a different way to show progress - tweak dialogs so that they show less empty space - if possible, set sane default selections in menu's to make the installation process smoother - fix many small bugs in user account creation, password dialog, user config extraction, removal of redundant configuration questions etc --- setup2hd/SeTupass.tpl | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'setup2hd/SeTupass.tpl') diff --git a/setup2hd/SeTupass.tpl b/setup2hd/SeTupass.tpl index 8cbadea..fcc7523 100644 --- a/setup2hd/SeTupass.tpl +++ b/setup2hd/SeTupass.tpl @@ -1,4 +1,8 @@ #!/bin/sh + +# The script defaults to curses dialog but Xdialog is a good alternative: +DIALOG=${DIALOG:-"dialog"} + TMP=/var/log/setup/tmp if [ ! -d $TMP ]; then mkdir -p $TMP @@ -6,17 +10,26 @@ fi UACCOUNT="$1" - UPASS1="" - UPASS2="" - UFORM="Define a new password for user '$UACCOUNT'" +UPASS1="" +UPASS2="" +UFORM="Define a new password for user '$UACCOUNT'" + while [ 0 ]; do - dialog --stdout --insecure --ok-label "Submit" --no-cancel \ - --title "@UDISTRO@ (@LIVEDE@) USER CREATION" \ - --passwordform "$UFORM" \ - 9 64 0 \ - "Password:" 1 1 "$UPASS1" 1 18 40 0 \ - "Repeat password:" 2 1 "$UPASS2" 2 18 40 0 \ + if [ "${DIALOG}" == "Xdialog" ]; then + ${DIALOG} --stdout --ok-label "Submit" --no-cancel \ + --title "@UDISTRO@ (@LIVEDE@) USER CREATION" \ + --left --separator="\n" --password --password \ + --2inputsbox "$UFORM" 20 40 \ + "Password: " "$UPASS1" "Repeat password: " "$UPASS2" \ 2>&1 1> $TMP/tempupass + else + ${DIALOG} --stdout --ok-label "Submit" --no-cancel \ + --title "@UDISTRO@ (@LIVEDE@) USER CREATION" \ + --insecure --passwordform "$UFORM" 9 64 0 "Password:" \ + 1 1 "$UPASS1" 1 18 40 0 "Repeat password:" 2 1 "$UPASS2" 2 18 40 0 \ + 2>&1 1> $TMP/tempupass + fi + iii=0 declare -a USERATTR while read LINE ; do -- cgit v1.2.3-65-gdbad