mount-umount.sh 817 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. _mount() {
  3. if [ -d $LFS ]; then
  4. mountpoint -q $LFS/dev || mount -v -B /dev $LFS/dev
  5. mountpoint -q $LFS/dev/pts || mount --bind /dev/pts $LFS/dev/pts
  6. mountpoint -q $LFS/proc || mount -vt proc proc $LFS/proc
  7. mountpoint -q $LFS/sys || mount -vt sysfs sysfs $LFS/sys
  8. mesaj bilgi "Ana sistem hazirlik klasorune mount edildi."
  9. else
  10. mesaj hata "LFS icin gerekli aygitlar mount edilemedi!"
  11. fi
  12. }
  13. _umount() {
  14. if [ -d $LFS ]; then
  15. mountpoint -q $LFS/proc && umount -l $LFS/proc/
  16. mountpoint -q $LFS/sys && umount -l $LFS/sys/
  17. mountpoint -q $LFS/dev/pts && umount -l $LFS/dev/pts/
  18. mountpoint -q $LFS/dev && umount -l $LFS/dev/
  19. mesaj bilgi "Hazirlik klasorunden aygitlar unmount edildi."
  20. else
  21. mesaj hata "Hazirlik klasorunden aygitlar unmount edilemedi!"
  22. fi
  23. }