From 2ed9faeb5a6c1e84fc129c5d637b520677a6dbb1 Mon Sep 17 00:00:00 2001 From: mfgbhatti Date: Sat, 19 Feb 2022 20:33:00 +0000 Subject: [PATCH] keeping logs --- 1-setup.sh | 4 ++-- archtitus.sh | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index 6bafc83..edcb162 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -14,7 +14,7 @@ fi echo "basic installations" install_pkg networkmanager dhclient reflector \ rsync arch-install-scripts \ - git pacman-contrib curl + git pacman-contrib curl efibootmgr install_xorg() { install_pkg xorg xorg-server xorg-xinit @@ -167,7 +167,7 @@ grub) install_pkg grub os-prober if [[ "$LUKS" -eq 1 ]]; then echo "Installing GRUB for LUKS" - sed -i -e 's/GRUB_CMDLINE_LINUX="\(.\+\)"/GRUB_CMDLINE_LINUX="\1 cryptdevice=UUID='"${ENCRYPT_UUID}"':luks"/g' -e 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="cryptdevice=UUID'"${ENCRYPT_UUID}"':luks"/g' /etc/default/grub + sed -i -e 's/GRUB_CMDLINE_LINUX="\(.\+\)"/GRUB_CMDLINE_LINUX="\1 cryptdevice=UUID='"${ENCRYPT_UUID}"':luks"/g' -e 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="cryptdevice=UUID='"${ENCRYPT_UUID}"':luks"/g' /etc/default/grub fi if [[ "$UEFI" -eq 1 ]]; then grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=ArchTitus diff --git a/archtitus.sh b/archtitus.sh index 6caf27a..b8e3920 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -27,8 +27,11 @@ logo() { " } -do_reboot () { +copy_logs() { cp "$LOG" "$MOUNTPOINT"/var/log/archtitus.log +} + +do_reboot () { if [[ "$LVM" -eq 1 || "$LUKS" -eq 1 ]]; then i=0 while [[ "$i" -le "${#LVM_NAMES[@]}" ]]; do @@ -42,6 +45,7 @@ do_reboot () { end() { REBOOT="true" + copy_logs for (( i = 15; i >= 1; i-- )); do read -r -s -n 1 -t 1 -p "Rebooting in $i seconds... Press Esc key to abort or press R key to reboot now."$'\n' KEY CODE="$?"