[scripts] update the way root password is removed, new chpasswd doesn't work anymore

This commit is contained in:
Fabio Erculiani 2010-09-28 21:18:40 +02:00
parent 1dae75d788
commit f44ddaded6

View File

@ -68,7 +68,9 @@ layman -d sabayon
rm -rf /var/lib/layman/sabayon
# Reset users' password
echo "root:" | chpasswd
# chpasswd doesn't work anymore
root_zeropass="root::$(cat /etc/shadow | grep "root:" | cut -d":" -f3-)"
sed -i "s/^root:.*/${root_zeropass}/" /etc/shadow
# protect /var/tmp
touch /var/tmp/.keep