summaryrefslogtreecommitdiffstats
path: root/source/installer/sources/initrd/usr/lib/setup/SeTpasswd
blob: 16133c4238a45cbe40f67b1ae3b859da6532b762 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
TMP=/var/log/setup/tmp
if [ ! -d $TMP ]; then
  mkdir -p $TMP
fi
T_PX="`cat $TMP/SeTT_PX`"
while [ "`cat $T_PX/etc/shadow | grep 'root:' | cut -f 2 -d :`" = "" ]; do
  # There is no root password
  dialog --title "WARNING: NO ROOT PASSWORD DETECTED" --yesno "There is \
currently no password set on the system administrator account (root). \
It is recommended that you set one now so that it is active the first \
time the machine is rebooted. This is especially important if you're \
using a network enabled kernel and the machine is on an Internet \
connected LAN. Would you like to set a root password?" 10 68
  if [ $? = 0 ] ; then
    clear
    echo
    echo
    echo
    echo "Setting password for 'root' user"
    chroot $T_PX /usr/bin/passwd root
    echo
    echo -n "Press [enter] to continue:"
    read junk;
    echo
    # Here we drop through, and if there's still no password the menu
    # runs again.
  else
    # Don't set a password:
    break;
  fi
done