armbian-firstlogin: fix root password handling

Root password was only applied when it was weak. The intention was
probably to warn when it was weak, but apply it regardless, so
make it so.
This commit is contained in:
Marco Nelissen
2022-11-27 17:17:51 -08:00
committed by marcone
parent 40effe1d23
commit e8f441a7e3

View File

@@ -357,8 +357,8 @@ if [[ -f /root/.not_logged_in_yet && -n $(tty) ]]; then
okay="$(awk -F': ' '{ print $2}' <<<"$result")"
if [[ "$okay" != "OK" ]]; then
echo -e "\n\e[0;31mWarning:\x1B[0m Weak password, $okay \b!"
(echo "$first_input";echo "$second_input";) | passwd root >/dev/null 2>&1
fi
(echo "$first_input";echo "$second_input";) | passwd root >/dev/null 2>&1
break
elif [[ -n $password ]]; then
echo -e "Rejected - \e[0;31mpasswords do not match.\x1B[0m Try again [${REPEATS}]."