fix: set always default passwords

This commit is contained in:
teldra 2021-03-13 14:39:10 +01:00
parent ff582894c3
commit 58841a417f
1 changed files with 8 additions and 4 deletions

View File

@ -69,16 +69,20 @@ if [[ ! ${cfg[fde_key_store]} == "none" ]]; then
if [[ "${cfg[diskpw]}" == "oem" ]]; then
echo "read -p \"Change PW for disk: y/n \" answer" > "${dest}"/etc/runit/core-services/99-changepwdisk.sh
echo "if [ \"\${answer}\" = \"y\" ]; then" >> "${dest}"/etc/runit/core-services/99-changepwdisk.sh
echo "cryptsetup luksChangeKey /dev/disk/by-uuid/${cfg[partuuid]}" >> "${dest}"/etc/runit/core-services/99-changepwdisk.sh
echo "rm -rf /etc/runit/core-services/99-changepwdisk.sh" >> "${dest}"/etc/runit/core-services/99-changepwdisk.sh
echo " while ! cryptsetup luksChangeKey /dev/disk/by-uuid/${cfg[partuuid]}; do" >> "${dest}"/etc/runit/core-services/99-changepwdisk.sh
echo " echo \"Again, please\"" >> "${dest}"/etc/runit/core-services/99-changepwdisk.sh
echo " done" >> "${dest}"/etc/runit/core-services/99-changepwdisk.sh
echo " rm -rf /etc/runit/core-services/99-changepwdisk.sh" >> "${dest}"/etc/runit/core-services/99-changepwdisk.sh
echo "fi" >> "${dest}"/etc/runit/core-services/99-changepwdisk.sh
fi
if [[ "${users[pw1]}" == "oem" ]]; then
echo "read -p \"Change PW for ${users[name1]}? y/n \" answer" > "${dest}"/etc/runit/core-services/99-changepwuser.sh
echo "if [ \"\${answer}\" = \"y\" ]; then" >> "${dest}"/etc/runit/core-services/99-changepwuser.sh
echo "passwd ${users[name1]}" >> "${dest}"/etc/runit/core-services/99-changepwuser.sh
echo "rm -rf /etc/runit/core-services/99-changepwuser.sh" >> "${dest}"/etc/runit/core-services/99-changepwuser.sh
echo " while ! passwd ${users[name1]}; do" >> "${dest}"/etc/runit/core-services/99-changepwuser.sh
echo " echo \"Again, please\"" >> "${dest}"/etc/runit/core-services/99-changepwuser.sh
echo " done" >> "${dest}"/etc/runit/core-services/99-changepwuser.sh
echo " rm -rf /etc/runit/core-services/99-changepwuser.sh" >> "${dest}"/etc/runit/core-services/99-changepwuser.sh
echo "fi" >> "${dest}"/etc/runit/core-services/99-changepwuser.sh
fi
fi