added functions to setup.conf

This commit is contained in:
mfgbhatti 2022-01-28 12:18:01 +00:00
parent e1a0f69d96
commit 7fb45b04a3
1 changed files with 24 additions and 16 deletions

View File

@ -2,7 +2,7 @@
# This script will ask users about their prefrences # This script will ask users about their prefrences
# like disk, file system, timezone, keyboard layout, # like disk, file system, timezone, keyboard layout,
# user name, password, etc. # user name, password, etc.
# shellcheck disable=SC2207 # shellcheck disable=SC2207,SC2120
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
@ -57,6 +57,11 @@ install_font () {
pacman -S --noconfirm --needed terminus-font pacman -S --noconfirm --needed terminus-font
} }
# timedatectl set-ntp true
set_ntp () {
timedatectl set-ntp true
}
# Check for UEFI # Check for UEFI
efi_check () { efi_check () {
if [[ -d "/sys/firmware/efi/" ]]; then if [[ -d "/sys/firmware/efi/" ]]; then
@ -71,20 +76,6 @@ efi_check () {
fi fi
} }
# Backround checks
background () {
if connection_test; then
echo -ne "ERROR! There seems to be no internet connection.\n"
exit 1
fi
check_arch
efi_check
check_root
check_country
install_font
setfont ter-v22b
}
# Check if an element exists # Check if an element exists
elements_present() { elements_present() {
for e in "${@:2}"; do [[ "$e" == "$1" ]] && break; done for e in "${@:2}"; do [[ "$e" == "$1" ]] && break; done
@ -120,7 +111,7 @@ title () {
# Write shared functions to to setup.conf # Write shared functions to to setup.conf
write_to_config() { write_to_config() {
cat << EOF >> "$CONFIG_FILE" cat << EOF > "$CONFIG_FILE"
#!/usr/bin/env bash #!/usr/bin/env bash
title () { title () {
@ -177,6 +168,23 @@ echo -ne "
" "
} }
# Backround checks
background () {
if connection_test; then
echo -ne "ERROR! There seems to be no internet connection.\n"
exit 1
fi
check_arch
efi_check
check_root
set_ntp
refresh_pacman
check_country
install_font
setfont ter-v22b
write_to_config
}
# Set partioning layouts # Set partioning layouts
setpartionlayout() { setpartionlayout() {
title "Setup Partioning Layout" title "Setup Partioning Layout"