summaryrefslogtreecommitdiffstats
path: root/SeTuacct.tpl
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2020-10-05 15:34:46 +0200
committer Eric Hameleers <alien@slackware.com>2020-10-05 15:34:46 +0200
commit70b689e6bf00338f55ae2daf1c2d0c2d972e00e8 (patch)
tree37dfca537a833973a2443133391f06c57d348e41 /SeTuacct.tpl
parent9abd86d3b8c45e32bce75bb6db402868e34631b6 (diff)
downloadliveslak-70b689e6bf00338f55ae2daf1c2d0c2d972e00e8.tar.gz
liveslak-70b689e6bf00338f55ae2daf1c2d0c2d972e00e8.tar.xz
setup2hd: add option to install regular Slackware via network mirror
The setup2hd script is a modified Slackware installer. For liveslak I had originally removed all the usual SOURCE selections and only allowed for the installation of the Live OS to harddisk. However, requests were sent to also support a regular installation of Slackware using the Live ISO. That is why I have now re-added all the Slackware network install choices (via NFS, HTTP, FTP or Samba mirror). I still left out the Slackware installation using local media; the Live ISO does not contain regular Slackware packages so that would not make sense.
Diffstat (limited to 'SeTuacct.tpl')
-rwxr-xr-xSeTuacct.tpl92
1 files changed, 0 insertions, 92 deletions
diff --git a/SeTuacct.tpl b/SeTuacct.tpl
deleted file mode 100755
index 5024f5d..0000000
--- a/SeTuacct.tpl
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/sh
-#TMP=/var/log/setup/tmp
-TMP=/tmp
-if [ ! -d $TMP ]; then
- mkdir -p $TMP
-fi
-
-freeuid() {
- # Get the first free UIDNumber after 999:
- local UIDS=$( cat ${T_PX}/etc/passwd | cut -d: -f3 | sort -n )
- local UID=999
- while true; do
- UID=$(( $UID + 1))
- if ! echo $UIDS | grep -F -q -w "$UID"; then
- break;
- fi
- done
- echo $UID
-}
-FREEUID="$(freeuid)"
-
-UFULLNAME=""
-UACCOUNT=""
-UACCTNR="$FREEUID"
-USHELL="/bin/bash"
-UFORM="Fill out your user details:"
-while [ 0 ]; do
- dialog --stdout --ok-label "Submit" --no-cancel \
- --title "@UDISTRO@ (@LIVEDE@) USER CREATION" \
- --form "$UFORM" \
- 11 64 0 \
- "Full Name:" 1 1 "$UFULLNAME" 1 14 40 0 \
- "Logonname:" 2 1 "$UACCOUNT" 2 14 32 0 \
- "UIDNumber:" 3 1 "$UACCTNR" 3 14 12 0 \
- "Login Shell:" 4 1 "$USHELL" 4 14 12 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
- UFULLNAME="${USERATTR[0]}"
- UACCOUNT="${USERATTR[1]}"
- UACCTNR="${USERATTR[2]}"
- USHELL="${USERATTR[3]}"
- unset USERATTR
- UINPUT=0
- # Validate the input:
- UACC_INVALID1="$(echo ${UACCOUNT:0:1} |tr -d 'a-z_')"
- UACC_INVALID="$(echo ${UACCOUNT:1} |tr -d 'a-z0-9_-')"
- if [ -n "$UACC_INVALID1" -o -n "$UACC_INVALID" ]; then
- # User account contains invalid characters, let's remove them all:
- UINPUT=1
- UACCOUNT="$(echo ${UACCOUNT} |tr -cd 'a-z_')"
- fi
- if [ -z "$UACCOUNT" -o -z "$UFULLNAME" ]; then
- # User account or fullname is empty, let's try again:
- UINPUT=$(expr $UINPUT + 2)
- fi
- if chroot ${T_PX} /usr/bin/id -u ${UACCTNR} 1>/dev/null 2>/dev/null ; then
- # UidNumber is already in use, fall back to sane default:
- UINPUT=$(expr $UINPUT + 4)
- UACCTNR=$FREEUID
- fi
- if ! grep -q ${USHELL} ${T_PX}/etc/shells ; then
- # Login shell is invalid, suggest the bash shell again:
- UINPUT=$(expr $UINPUT + 8)
- USHELL=/bin/bash
- fi
- if [ $UINPUT -eq 0 ]; then
- break
- elif [ $UINPUT -eq 1 ]; then
- UFORM="Please only use valid characters for logonname"
- elif [ $UINPUT -eq 2 ]; then
- UFORM="Please enter your logon and full name"
- elif [ $UINPUT -eq 3 ]; then
- UFORM="Use valid characters for logonname, and enter full name"
- elif [ $UINPUT -eq 4 ]; then
- UFORM="Enter unused number for your account, $FREEUID is a good default"
- elif [ $UINPUT -eq 8 ]; then
- UFORM="Please enter a valid shell"
- else
- UFORM="Fill all fields, using valid logonname/uidnumber values"
- fi
-done
-
-echo "UACCOUNT=$UACCOUNT"
-echo "UFULLNAME='$UFULLNAME'"
-echo "UACCTNR=$UACCTNR"
-echo "USHELL=$USHELL"