From e28f8cd12f95c62e3c98a75864deedcd3b82c2e1 Mon Sep 17 00:00:00 2001 From: mfgbhatti Date: Sat, 19 Feb 2022 15:23:58 +0000 Subject: [PATCH] adding user root check --- 0-preinstall.sh | 4 ++-- 1-setup.sh | 8 ++++---- 2-user.sh | 8 ++++---- 3-post-setup.sh | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/0-preinstall.sh b/0-preinstall.sh index 181459b..90fb2f7 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -8,7 +8,7 @@ if [[ -f "$CONFIG_FILE" ]]; then source "$CONFIG_FILE" else echo "ERROR! Missing file: setup.conf" - exit 1 + exit 0 fi make_boot() { @@ -225,7 +225,7 @@ if [[ "$(grep -E "$MOUNTPOINT" /proc/mounts -c)" -eq "0" ]]; then echo "Rebooting in 2 Seconds ..." && sleep 1 echo "Rebooting in 1 Second ..." && sleep 1 # reboot now - exit 1 + exit 0 fi echo "Arch Install on Main Drive" diff --git a/1-setup.sh b/1-setup.sh index 3ddf2c2..bac4fa0 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -8,7 +8,7 @@ if [[ -f "$CONFIG_FILE" ]]; then source "$CONFIG_FILE" else echo "ERROR! Missing file: setup.conf" - exit 1 + exit 0 fi echo "basic installations" @@ -190,7 +190,7 @@ systemd) echo -e "default arch\ntimeout\t5" >/boot/loader/loader.conf else echo "ERROR! Systemd-boot is not supported for BIOS systems" - exit 1 + exit 0 fi ;; uefi) @@ -209,7 +209,7 @@ uefi) fi else echo "ERROR! efistub is not supported for BIOS systems" - exit 1 + exit 0 fi ;; none) @@ -221,7 +221,7 @@ none) esac echo "Adding User and hostname" -if [ "$(id -u)" = "0" ]; then +if [ "$(id -u)" -eq "0" ]; then if [[ "$LAYOUT" -eq 1 ]]; then groupadd libvirt useradd -m -G wheel,libvirt -s /bin/bash "$USERNAME" diff --git a/2-user.sh b/2-user.sh index 84cc53c..5fa58b6 100755 --- a/2-user.sh +++ b/2-user.sh @@ -12,14 +12,14 @@ if [[ -f "$CONFIG_FILE" ]]; then source "$CONFIG_FILE" else echo "ERROR! Missing file: setup.conf" - exit 1 + exit 0 fi install_aur() { "$AURHELPER" -S --noconfirm --needed "$@" } -cd ~ || exit 1 +cd ~ || exit 0 case "$AURHELPER" in "yay") install_pkg "go" @@ -44,9 +44,9 @@ case "$AURHELPER" in ;; esac -cd "$AURHELPER" || exit 1 +cd "$AURHELPER" || exit 0 makepkg -si --noconfirm -cd ~ || exit 1 +cd ~ || exit 0 while IFS= read -r LINE; do echo "INSTALLING: $LINE" diff --git a/3-post-setup.sh b/3-post-setup.sh index 72990ba..fcdb956 100755 --- a/3-post-setup.sh +++ b/3-post-setup.sh @@ -8,7 +8,7 @@ if [[ -f "$CONFIG_FILE" ]]; then source "$CONFIG_FILE" else echo "ERROR! Missing file: setup.conf" - exit 1 + exit 0 fi if [[ "$LAYOUT" -eq 1 || "$BOOTLOADER" =~ "grub" ]]; then @@ -18,7 +18,7 @@ if [[ "$LAYOUT" -eq 1 || "$BOOTLOADER" =~ "grub" ]]; then echo -e "Creating the theme directory..." mkdir -p "${THEME_DIR}/${THEME_NAME}" echo -e "Copying the theme..." - cd "$HOME"/ArchTitus || exit 1 + cd "$HOME"/ArchTitus || exit 0 cp -a ${THEME_NAME}/* ${THEME_DIR}/${THEME_NAME} echo -e "Backing up Grub config..." cp -an /etc/default/grub /etc/default/grub.bak @@ -60,4 +60,4 @@ rm -r /root/ArchTitus rm -r /home/"$USERNAME"/ArchTitus # Replace in the same state -cd "$(pwd)" || exit 1 \ No newline at end of file +cd "$(pwd)" || exit 0 \ No newline at end of file