diff options
author | Eric Hameleers <alien@slackware.com> | 2020-10-24 22:29:54 +0200 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2020-10-24 22:29:54 +0200 |
commit | 3bb48a9c945dbafbbc912ef8d65234d88cb65794 (patch) | |
tree | 63ce1d983031b5a8bb8371bc690c689acac39ed4 /setup2hd/SeTpasswd.tpl | |
parent | 2e29bd396c899fdf2e99504c37c993d4576b8244 (diff) | |
download | liveslak-3bb48a9c945dbafbbc912ef8d65234d88cb65794.tar.gz liveslak-3bb48a9c945dbafbbc912ef8d65234d88cb65794.tar.xz |
setup2hd fixes and enhancements
DAW configuration is now properly copied
Extracting the Live OS to hard disk is roughly 10 times faster now,
after abandoning the fancy progress bar and just showing the rsync status.
Use an enhanced Slackware SeTpasswd to add a non-root user and set
the root password.
Various syntax and logic errors removed.
Diffstat (limited to '')
-rw-r--r-- | setup2hd/SeTpasswd.tpl (renamed from setup2hd/SeTpasswd) | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/setup2hd/SeTpasswd b/setup2hd/SeTpasswd.tpl index 4208306..04d7c8c 100644 --- a/setup2hd/SeTpasswd +++ b/setup2hd/SeTpasswd.tpl @@ -1,18 +1,39 @@ +#!/bin/sh # Liveslak replacement for Slackware's SeTpassword script. +TMP=/var/log/setup/tmp +if [ ! -d $TMP ]; then + mkdir -p $TMP +fi +T_PX="$(cat $TMP/SeTT_PX)" + +# Check for root password: +if [ "$(cat $T_PX/etc/shadow | grep 'root:' | cut -f 2 -d :)" != "" ]; then + # Root password has been set, nothing further to be done. + exit 0 +fi + +# No root password has been set yet, which means no user was created either. + # Set up a user account, +if [ -r $TMP/SeTlive ]; then + # We will only configgure su access when installing a Live OS: + SUTEXT="\nYour account will be added to sudoers and suauth." +else + SUTEXT="" +fi dialog --title "@UDISTRO@ (@LIVEDE@) USER CREATION" \ --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ --msgbox "You will first get the chance to create your user account, \ -and set its password.\nYour account will be added to sudoers and suauth.\n\n\ -After that, you will be asked to set the root password." 9 55 +and set its password.${SUTEXT}\n\n\ +After that, you will be asked to set the root password." 11 55 # This will set UFULLNAME, UACCOUNT and USHELL variables: -SeTuacct 2>&1 1> $TMP/tempresult +SeTuacct 2>&1 1> $TMP/temppasswd if [ $? = 0 ]; then # User filled out the form, so let's get the results for # UFULLNAME, UACCOUNT, UACCTNR and USHELL: - source $TMP/tempresult - rm -f $TMP/tempresult + source $TMP/temppasswd + rm -f $TMP/temppasswd # Set a password for the new account: UPASS=$(SeTupass $UACCOUNT) # Create the account and set the password: @@ -21,10 +42,7 @@ if [ $? = 0 ]; then unset UPASS fi # End user creation -# Check for root password: -if [ "$(cat $T_PX/etc/shadow | grep 'root:' | cut -f 2 -d :)" = "" ]; then - # There is no root password yet: - UPASS=$(SeTupass root) - echo "root:${UPASS}" | chroot ${T_PX} /usr/sbin/chpasswd - unset UPASS -fi +# Finally, set the root password: +UPASS=$(SeTupass root) +echo "root:${UPASS}" | chroot ${T_PX} /usr/sbin/chpasswd +unset UPASS |