move checks behind action

This commit is contained in:
Tobias Powalowski 2023-08-02 15:39:16 +02:00
parent 03fc0b043e
commit 7c7c235f87
2 changed files with 16 additions and 6 deletions

View file

@ -42,11 +42,15 @@ _download_latest
if [[ -n "${_L_COMPLETE}" || -n "${_L_INSTALL_COMPLETE}" ]]; then if [[ -n "${_L_COMPLETE}" || -n "${_L_INSTALL_COMPLETE}" ]]; then
_TITLE="Archboot $(uname -m) | Basic Setup | New Environment" _TITLE="Archboot $(uname -m) | Basic Setup | New Environment"
_new_environment | _dialog --title "${_MENU_TITLE}" --gauge "Waiting for pacman keyring..." 6 75 0 _new_environment | _dialog --title "${_MENU_TITLE}" --gauge "Waiting for pacman keyring..." 6 75 0
clear
_update_installer_check
fi fi
# Generate new images # Generate new images
if [[ -n "${_G_RELEASE}" ]]; then if [[ -n "${_G_RELEASE}" ]]; then
_TITLE="Archboot $(uname -m) | Basic Setup | New Images" _TITLE="Archboot $(uname -m) | Basic Setup | New Images"
_new_image | _dialog --title "${_MENU_TITLE}" --gauge "Removing not necessary files from /..." 6 75 0 _new_image | _dialog --title "${_MENU_TITLE}" --gauge "Removing not necessary files from /..." 6 75 0
clear
_update_installer_check
fi fi
# install custom xorg or wayland # install custom xorg or wayland
if [[ -n "${_CUSTOM_X}" || -n "${_CUSTOM_WAYLAND}" ]]; then if [[ -n "${_CUSTOM_X}" || -n "${_CUSTOM_WAYLAND}" ]]; then
@ -64,5 +68,8 @@ fi
if [[ -n "${_FULL_SYSTEM}" ]]; then if [[ -n "${_FULL_SYSTEM}" ]]; then
_TITLE="Archboot $(uname -m) | Basic Setup | Full System" _TITLE="Archboot $(uname -m) | Basic Setup | Full System"
_full_system | _dialog --title "${_MENU_TITLE}" --gauge "Refreshing pacman package database..." 6 75 0 _full_system | _dialog --title "${_MENU_TITLE}" --gauge "Refreshing pacman package database..." 6 75 0
clear
_update_installer_check
_full_system_check
fi fi
rm /.update rm /.update

View file

@ -68,6 +68,14 @@ _update_installer_check() {
fi fi
} }
_full_system_check() {
if [[ -e "/.full_system" ]]; then
clear
echo -e "\e[1mFull Arch Linux system already setup.\e[m"
exit 1
fi
}
_gpg_check() { _gpg_check() {
# pacman-key process itself # pacman-key process itself
while pgrep -x pacman-key &>"${_NO_LOG}"; do while pgrep -x pacman-key &>"${_NO_LOG}"; do
@ -119,7 +127,6 @@ _download_latest() {
if [[ -n "${_D_SCRIPTS}" ]]; then if [[ -n "${_D_SCRIPTS}" ]]; then
_update_installer_check _update_installer_check
touch /.update touch /.update
_network_check
echo -e "\e[1mStart:\e[m Downloading latest archboot from GIT master tree..." echo -e "\e[1mStart:\e[m Downloading latest archboot from GIT master tree..."
[[ -d "${_INST}" ]] || mkdir "${_INST}" [[ -d "${_INST}" ]] || mkdir "${_INST}"
# config # config
@ -282,11 +289,7 @@ _new_environment() {
_full_system() { _full_system() {
_update_installer_check _update_installer_check
touch /.update touch /.update
if [[ -e "/.full_system" ]]; then _full_system_check
clear
echo -e "\e[1mFull Arch Linux system already setup.\e[m"
exit 1
fi
_progress "1" "Refreshing pacman package database..." _progress "1" "Refreshing pacman package database..."
pacman -Sy >"${_LOG}" 2>&1 || exit 1 pacman -Sy >"${_LOG}" 2>&1 || exit 1
_PACKAGES="$(pacman -Qqn)" _PACKAGES="$(pacman -Qqn)"