1 # This file is part of the 'dragora-installer'.
3 # Purpose: Set super-user (root) password.
5 # Make sure to have /dev available for passwd(1)
6 if ! mountpoint -q /media/dragora-root/dev
8 mount --bind /dev /media/dragora-root/dev
11 while test "$(grep -m 1 "^root:" /media/dragora-root/etc/shadow | cut -f 2 -d :)" = x
16 --backtitle "\\ZbSystem administrator password" \
17 --title "PASSWORD NOT DETECTED" \
19 "No password has been detected for the system administrator\\n\
20 (root) account.\\n\\nIt is important to set it in order to \
21 have access to the entire system. Please do it now!" 10 62 || _status=$?
22 if test $_status -eq 0
25 chroot /media/dragora-root /usr/bin/passwd root
27 echo " To continue, press [Enter]..."
28 IFS= read -r REPLY < /dev/tty || exit 2;
31 elif test $_status -eq 255
34 --title "System administrator password" \
36 "\\nAre you sure you want to leave this without a password?\\n\
37 You will not have full access to the system." 8 59 || continue;
43 # Refresh shadow files
44 chroot /media/dragora-root /usr/sbin/shadowconfig off > /dev/null 2>&1 || true
45 chroot /media/dragora-root /usr/sbin/shadowconfig on > /dev/null 2>&1 || true