#!/bin/zsh
echo -e "This script will now complete the installation\n"

#change shadow default settings
sed -i 's/yes/no/' /etc/default/useradd
sed -i 's/bash/zsh/' /etc/default/useradd

#enable shadow user and group
pwconv
grpconv

# Set root password
passwd -d root > /dev/null

# get RPM db error
rpm -qa > /dev/null 2>&1

#rebuild DB after error
rpm --rebuilddb --root=/

#add first boot scripts
cat > /root/first_boot.sh << "EOF"
#!/bin/bash
#rebuild RPM DB
rpm --rebuilddb --root=/

# set root password
echo "Now enter the root password or leave blank for none."
passwd root

# remove this file
rm /root/first_boot.sh
EOF

chmod +x /root/first_boot.sh

# remove this script
rm chroot.sh

