summaryrefslogtreecommitdiffstats
path: root/SeTupass.tpl
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2020-02-20 00:27:31 +0100
committer Eric Hameleers <alien@slackware.com>2020-02-20 00:27:31 +0100
commiteb6350692ddf11d9ababf90d61b8b0e612c724a0 (patch)
treece323070f0a1a82557c4ef41d1e7da3a6bf22ae3 /SeTupass.tpl
parent6dd435b71505b13f2d1d56fabf9d4242b7e059c5 (diff)
downloadliveslak-eb6350692ddf11d9ababf90d61b8b0e612c724a0.tar.gz
liveslak-eb6350692ddf11d9ababf90d61b8b0e612c724a0.tar.xz
setup2hd: several usability improvements
- Include disk partitioning (cgdisk and/or cfdisk) in the setup2hd (calling new script 'Setudiskpart'). - Create a non-root user and set the root password through dialogs (calling new scripts 'SeTuacct' and 'SeTupass'). - Attempt to speed up the rsync from the squashfs files to the hard drive.
Diffstat (limited to '')
-rwxr-xr-xSeTupass.tpl42
1 files changed, 42 insertions, 0 deletions
diff --git a/SeTupass.tpl b/SeTupass.tpl
new file mode 100755
index 0000000..ff662ab
--- /dev/null
+++ b/SeTupass.tpl
@@ -0,0 +1,42 @@
+#!/bin/sh
+TMP=/var/log/setup/tmp
+if [ ! -d $TMP ]; then
+ mkdir -p $TMP
+fi
+
+UACCOUNT="$1"
+
+ 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 \
+ 2>&1 1> $TMP/tempresult
+ iii=0
+ declare -a USERATTR
+ while read LINE ; do
+ USERATTR[$iii]="$LINE"
+ iii=$(expr $iii + 1)
+ done < $TMP/tempresult
+ rm -f $TMP/tempresult
+ UPASS1="${USERATTR[0]}"
+ UPASS2="${USERATTR[1]}"
+ unset USERATTR
+ if [ -z "$UPASS1" ]; then
+ UFORM="Password must not be empty, try again for user '$UACCOUNT'"
+ elif [ "$UPASS1" == "$UPASS2" ]; then
+ break
+ else
+ UFORM="Passwords do not match, try again for user '$UACCOUNT'"
+ fi
+ done
+ echo "${UPASS1}"
+ unset UPASS1
+ unset UPASS2
+ unset USERATTR
+