Remove {} for variables

pull/1/head
Lexi 2 years ago
parent 1e5a1b49f2
commit a01c09c66d

@ -61,14 +61,14 @@ while [[ "$matches" == "false" ]]; do
passwrong="true" passwrong="true"
fi fi
done done
crypt_password=$(openssl passwd -crypt ${password}) crypt_password=$(openssl passwd -crypt $password)
# Root password # Root password
clear clear
different_root_password=true different_root_password=true
gum confirm "$(gum style --border normal --margin '1' --padding '1 2' --border-foreground 212 'Use same password for root?')" && different_root_password=false gum confirm "$(gum style --border normal --margin '1' --padding '1 2' --border-foreground 212 'Use same password for root?')" && different_root_password=false
if [[ $different_root_password != "true" ]]; then if [[ $different_root_password != "true" ]]; then
root_password=${password} # set root password same as user password root_password=$password # set root password same as user password
else else
root_matches="false" root_matches="false"
root_passwrong="false" root_passwrong="false"
@ -101,7 +101,7 @@ hostname=$(gum input --placeholder "Please enter a hostname")
clear clear
gum style --border normal --margin "1" --padding "1 2" --border-foreground 212 "Please select the disk to install to" "$(gum style --foreground 212 'WARNING: This will erease the whole disk')" gum style --border normal --margin "1" --padding "1 2" --border-foreground 212 "Please select the disk to install to" "$(gum style --foreground 212 'WARNING: This will erease the whole disk')"
disk_dev=$(lsblk -pdo name | grep -v zram | grep -v NAME | grep -v loop | grep -v sr | gum choose --limit 1) disk_dev=$(lsblk -pdo name | grep -v zram | grep -v NAME | grep -v loop | grep -v sr | gum choose --limit 1)
disk=$(echo ${disk_dev} | awk '{ print substr ($0, 6 ) }') disk=$(echo $disk_dev | awk '{ print substr ($0, 6 ) }')
# Select desktop # Select desktop
clear clear
@ -136,13 +136,13 @@ if [[ $is_uefi == "true" ]]; then
grub_location="/boot/efi" grub_location="/boot/efi"
else else
grub_type="grub-legacy" grub_type="grub-legacy"
grub_location="${disk_dev}" grub_location="$disk_dev"
fi fi
# Summary # Summary
clear clear
CONTINUE=false CONTINUE=false
gum confirm "$(gum style --border normal --margin '1' --padding '1 2' --border-foreground 212 "Summary, is this correct?" "" "keymap: ${keymap}" "timezone: ${timezone}" "locale: ${locale}" "username: ${username}" "password: ${password}" "Default shell: ${shell}" "root-password: ${root_password}" "hostname: ${hostname}" "disk: ${disk}" "desktop: ${desktop}" "ipv6: ${enable_ipv6}" "timeshift: ${enable_timeshift}" "enable zramd: ${enable_zramd}" "enable flatpak: ${enable_flatpak}" "efi: ${is_uefi}")" && CONTINUE=true gum confirm "$(gum style --border normal --margin '1' --padding '1 2' --border-foreground 212 "Summary, is this correct?" "" "keymap: $keymap" "timezone: $timezone" "locale: $locale" "username: $username" "password: $password" "Default shell: $shell" "root-password: $root_password" "hostname: $hostname" "disk: $disk" "desktop: $desktop" "ipv6: $enable_ipv6" "timeshift: $enable_timeshift" "enable zramd: $enable_zramd" "enable flatpak: $enable_flatpak" "efi: $is_uefi")" && CONTINUE=true
if [[ $CONTINUE != "true" ]]; then if [[ $CONTINUE != "true" ]]; then
echo "Exiting. Have a good day!" echo "Exiting. Have a good day!"
exit exit
@ -154,46 +154,46 @@ else
# Make config.json # Make config.json
echo "{ echo "{
\"partition\": { \"partition\": {
\"device\": \"${disk}\", \"device\": \"$disk\",
\"mode\": \"Auto\", \"mode\": \"Auto\",
\"efi\": ${is_uefi}, \"efi\": $is_uefi,
\"partitions\": [] \"partitions\": []
}, },
\"bootloader\": { \"bootloader\": {
\"type\": \"${grub_type}\", \"type\": \"$grub_type\",
\"location\": \"${grub_location}\" \"location\": \"$grub_location\"
}, },
\"locale\": { \"locale\": {
\"locale\": [ \"locale\": [
\"${locale}\" \"$locale\"
], ],
\"keymap\": \"${keymap}\", \"keymap\": \"$keymap\",
\"timezone\": \"${timezone}\" \"timezone\": \"$timezone\"
}, },
\"networking\": { \"networking\": {
\"hostname\": \"${hostname}\", \"hostname\": \"$hostname\",
\"ipv6\": ${enable_ipv6} \"ipv6\": $enable_ipv6
}, },
\"users\": [ \"users\": [
{ {
\"name\": \"${username}\", \"name\": \"$username\",
\"password\": \"${crypt_password}\", \"password\": \"$crypt_password\",
\"hasroot\": true, \"hasroot\": true,
\"shell\": \"${shell}\" \"shell\": \"$shell\"
} }
], ],
\"rootpass\": \"${crypt_root_password}\", \"rootpass\": \"$crypt_root_password\",
\"desktop\": \"${desktop}\", \"desktop\": \"$desktop\",
\"timeshift\": ${enable_timeshift}, \"timeshift\": $enable_timeshift,
\"extra_packages\": [ \"extra_packages\": [
\"fish\" \"fish\"
], ],
\"flatpak\": ${enable_flatpak}, \"flatpak\": $enable_flatpak,
\"zramd\": ${enable_zramd}, \"zramd\": $enable_zramd,
\"unakite\": { \"unakite\": {
\"enable\": false, \"enable\": false,
\"root\": \"/dev/null\", \"root\": \"/dev/null\",
\"oldroot\": \"${disk}\", \"oldroot\": \"$disk\",
\"efidir\": \"/dev/null\", \"efidir\": \"/dev/null\",
\"bootdev\": \"/dev/null\" \"bootdev\": \"/dev/null\"
}, },
@ -208,5 +208,5 @@ if [[ $CONTINUE != "true" ]]; then
echo "Exiting. Have a good day!" echo "Exiting. Have a good day!"
exit exit
else else
sudo jade config /tmp/config.json # sudo jade config /tmp/config.json
fi fi

Loading…
Cancel
Save