From 1718a6ab53bec312a15ed7c74ef67e749259ce62 Mon Sep 17 00:00:00 2001 From: Matt C Date: Tue, 24 Aug 2021 20:58:14 -0400 Subject: [PATCH] loop if passwd doesn't return a 1 --- continue.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/continue.sh b/continue.sh index 31841bc..f352864 100755 --- a/continue.sh +++ b/continue.sh @@ -80,14 +80,27 @@ echo "127.0.1.1 ${HOSTNAME}.localdomain ${HOSTNAME}" >> /etc/hosts clear inf "Password for root" -passwd +done="nope" +while [[ "$done" == "nope" ]]; do + passwd + if [[ "$(echo $?)" == "0" ]]; then + done="yep" + fi +done prompt "Your username" UN="$response" useradd -m ${UN} usermod -aG wheel ${UN} inf "Set password for ${UN}" -passwd ${UN} +done="nope" +while [[ "$done" == "nope" ]]; do + passwd ${UN} + if [[ "$(echo $?)" == "0" ]]; then + done="yep" + fi +done + echo >> /etc/sudoers echo "# Enabled by Crystalinstall" >> /etc/sudoers echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers