pentoo-livecd: introduce new tool for setting livecd user password if unset

This commit is contained in:
Rick Farina (Zero_Chaos) 2016-08-17 13:04:08 -04:00
parent 339e3b62b9
commit a801b9c805
No known key found for this signature in database
GPG key ID: A5DD1427DD11F94A
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,19 @@
#!/bin/sh
setpassword(){
printf "RFC 2119: MUST means an absolute requirement\n"
printf "You *MUST* set a password to continue. Do not forget your password.\n"
sudo passwd pentoo
}
changeuser="${USER}"
if grep -q "${changeuser}:!" /etc/shadow; then
printf "For your security, Pentoo does not come with a default password.\n"
printf "To protect your session you must set a password now.\n"
printf "Do not forget your password.\n"
sudo passwd ${changeuser}
fi
while sudo grep -q "${changeuser}:!" /etc/shadow; do
setpassword
done

View file

@ -41,4 +41,6 @@ src_install() {
doexe "${FILESDIR}"/networkmanager.desktop
exeinto /etc/skel/Desktop
newexe "${FILESDIR}"/sudo-networkmanager.desktop networkmanager.desktop
dosbin "${FILESDIR}"/livecd-setpass
}