Advertisement
metalx1000

Download and extract Slitaz Flie System

Jun 17th, 2016
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.56 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #check if root user
  4. if [[ $EUID -ne 0 ]]; then
  5.   echo "You must be a root user"
  6.   echo "Trying to restart script as sudo"
  7.   sudo $0
  8.   exit
  9. fi
  10.  
  11. #make folder to work in
  12. mkdir -p slitaz/mnt
  13. mkdir -p slitaz/fs
  14. cd slitaz
  15.  
  16. url="http://mirror.slitaz.org/iso/4.0/slitaz-4.0.iso"
  17. iso="slitaz.iso"
  18.  
  19. #download iso
  20. wget -c "$url" -O $iso
  21.  
  22. mount -o loop slitaz.iso mnt
  23. cp mnt/boot/rootfs*.gz fs
  24. umount mnt
  25.  
  26. cd fs
  27. for i in {1..4}
  28. do
  29.   echo "Extracting rootfs$i.gz..."
  30.   unlzma rootfs$i.gz -S .gz
  31.   cat rootfs$i | cpio -id
  32.   rm rootfs$i
  33. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement