turn password input dialog prompt

pull/3/head
Amy 3 years ago
parent d82d2d7f6f
commit a7f857ca36
No known key found for this signature in database
GPG Key ID: 6672E6DD65BEA50B

@ -30,6 +30,11 @@ msgdat=""
msgbox(){ msgbox(){
msgdat=$(dialog --title Citrine --inputbox "$@" --stdout 10 80) msgdat=$(dialog --title Citrine --inputbox "$@" --stdout 10 80)
} }
pass=""
passbox(){
pass=$(dialog --title Citrine --insecure --passwordbox "$@" --stdout 10 80)
}
# -------------------------- # --------------------------
if [[ "$EUID" != "0" ]]; then if [[ "$EUID" != "0" ]]; then
@ -260,26 +265,18 @@ genfstab -U /mnt > /mnt/etc/fstab
clear clear
TZ="/usr/share/place/holder" cd /usr/share/zoneinfo/
while [[ ! -f $TZ ]]; do var=$(echo */ | sed 's/\///g' | sed 's/ /" "" "/g')
msgbox "Pick a time zone (Format: America/New_York, Europe/London, etc)" var=$(echo \"$var\")
PT="$msgdat" loc1=$(dialog --title "Citrine" --menu "Please pick a time zone" 20 100 43 $var "" --stdout)
TZ="/usr/share/zoneinfo/${PT}" loc1=$(echo $loc1 | sed 's/"//g')
done cd /usr/share/zoneinfo/$loc1
var1=$(echo * | sed 's/\///g' | sed 's/ /" "" "/g')
var1=$(echo \"$var1\")
#cd /usr/share/zoneinfo/ loc2=$(dialog --title "Citrine" --menu "Please pick a time zone" 20 100 43 $var1 "" --stdout)
#var=$(echo */ | sed 's/\///g' | sed 's/ /" "" "/g') loc2=$(echo $loc1 | sed 's/"//g')
#var=$(echo \"$var\") TZ="/usr/share/zoneinfo/$loc1/$loc2"
#loc1=$(dialog --title "Citrine" --menu "Please pick a time zone" 20 100 43 $var "" --stdout) cd /
#loc1=$(echo $loc1 | sed 's/"//g')
#cd /usr/share/zoneinfo/$loc1
#var1=$(echo * | sed 's/\///g' | sed 's/ /" "" "/g')
#var1=$(echo \"$var1\")
#loc2=$(dialog --title "Citrine" --menu "Please pick a time zone" 20 100 43 $var1 "" --stdout)
#loc2=$(echo $loc1 | sed 's/"//g')
#TZ="/usr/share/zoneinfo/$loc1/$loc2"
#cd /
arch-chroot /mnt ln -sf $TZ /etc/localtime arch-chroot /mnt ln -sf $TZ /etc/localtime
inf "Set TZ to ${TZ}" inf "Set TZ to ${TZ}"
@ -345,6 +342,19 @@ while [[ "$done" == "nope" ]]; do
done="yep" done="yep"
fi fi
done done
while [[ "$done" == "nope" ]]; do
passbox "Please enter root password"
passInit="$pass"
passbox "Please confirm root password"
passConf="$pass"
if [[ "$passInit" == "$passConf" ]]; then
done="yep"
else
dumptitle "Password error"
dump "Passwords do not match. Please try again."
fi
done
arch-chroot /mnt usermod --password $(echo ${pass} | openssl passwd -1 -stdin) ${UN}
msgbox "Your username" msgbox "Your username"
UN="$msgdat" UN="$msgdat"
@ -353,11 +363,19 @@ arch-chroot /mnt usermod -aG wheel ${UN}
inf "Set password for ${UN}" inf "Set password for ${UN}"
done="nope" done="nope"
while [[ "$done" == "nope" ]]; do while [[ "$done" == "nope" ]]; do
arch-chroot /mnt passwd ${UN} passbox "Please enter password for ${UN}"
if [[ "$(echo $?)" == "0" ]]; then passInit="$pass"
passbox "Please confirm password for ${UN}"
passConf="$pass"
if [[ "$passInit" == "$passConf" ]]; then
done="yep" done="yep"
else
dumptitle "Password error"
dump "Passwords do not match. Please try again."
fi fi
done done
arch-chroot /mnt usermod --password $(echo ${pass} | openssl passwd -1 -stdin) ${UN}
echo >> /mnt/etc/sudoers echo >> /mnt/etc/sudoers
echo "# Enabled by Crystalinstall (citrine)" >> /mnt/etc/sudoers echo "# Enabled by Crystalinstall (citrine)" >> /mnt/etc/sudoers
echo "%wheel ALL=(ALL) ALL" >> /mnt/etc/sudoers echo "%wheel ALL=(ALL) ALL" >> /mnt/etc/sudoers
@ -447,7 +465,10 @@ if [[ "$DM" == "" ]]; then
prompt "" prompt ""
ND="$response" ND="$response"
echo "ND=$ND" echo "ND=$ND"
if [[ "$ND" != "" ]]; then if [[ "$ND" == "blank" || "$ND" == "none" || "$ND" == "" ]]; then
inf "Ok, we will skip the DM install"
DM=""
else
inf "Ok, we'll install $ND" inf "Ok, we'll install $ND"
DM="$ND" DM="$ND"
arch-chroot /mnt pacman -S --quiet --noconfirm $DM arch-chroot /mnt pacman -S --quiet --noconfirm $DM
@ -455,7 +476,7 @@ if [[ "$DM" == "" ]]; then
inf "Ok, not installing a display manager." inf "Ok, not installing a display manager."
fi fi
else else
if [[ "$DM" == "none" ]]; then if [[ "$DM" != "none" ]]; then
arch-chroot /mnt pacman -S --quiet --noconfirm $DM arch-chroot /mnt pacman -S --quiet --noconfirm $DM
fi fi
fi fi

Loading…
Cancel
Save