Skip to content

Commit

Permalink
Update fulloto.sh
Browse files Browse the repository at this point in the history
Disk biçimlendirmesi ve montajı öncesi kontrol eklendi

- Disklerin zaten biçimlendirilmiş ve monte edilmiş olup olmadığını kontrol eden check_disk_format fonksiyonu eklendi.
- Diskler zaten hazırsa bölme ve biçimlendirme adımlarını atlamak için main fonksiyonu değiştirildi.
- Kesintilere karşı scriptin dayanıklılığı artırıldı ve gereksiz disk işlemlerinden kaçınıldı.
  • Loading branch information
yuceltoluyag committed Aug 3, 2024
1 parent 6dac441 commit 523faad
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions fulloto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,16 @@ format_disk() {
swapon "${disk}2"
}

check_disk_format() {
local disk=$1
if mount | grep -q "/mnt"; then
print "Disk zaten biçimlendirilmiş ve monte edilmiş, bu adımlar atlanacak."
return 1
else
return 0
fi
}

run_arch_chroot() {
arch-chroot /mnt /bin/bash -e <<EOF
ln -sf /usr/share/zoneinfo/\$(curl -s http://ip-api.com/line?fields=timezone) /etc/localtime
Expand All @@ -263,8 +273,12 @@ main() {
show_logo
check_internet
select_disk
partition_disk "$DISK"
format_disk "$DISK"

if check_disk_format "$DISK"; then
partition_disk "$DISK"
format_disk "$DISK"
fi

select_kernel
detect_microcode
detect_virtualization
Expand Down

0 comments on commit 523faad

Please sign in to comment.