adding user root check

This commit is contained in:
mfgbhatti 2022-02-19 15:23:58 +00:00
parent 2c1397053c
commit e28f8cd12f
4 changed files with 13 additions and 13 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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
cd "$(pwd)" || exit 0