Advertisement
Sweetening

debian compressed iso

Jul 26th, 2024
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Define the URL and file names
  4. ISO_URL="https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.6.0-amd64-netinst.iso"
  5. ISO_FILE="debian-12.6.0-amd64-netinst.iso"
  6. ISO_MOUNT_DIR="iso_mount"
  7.  
  8. # Create a directory for mounting the ISO
  9. mkdir -p "$ISO_MOUNT_DIR"
  10.  
  11. # Download the ISO file
  12. echo "Downloading ISO..."
  13. wget -O "$ISO_FILE" "$ISO_URL"
  14.  
  15. # Check if the ISO downloaded successfully
  16. if [[ $? -ne 0 ]]; then
  17. echo "Failed to download ISO."
  18. exit 1
  19. fi
  20.  
  21. # Mount the ISO
  22. echo "Mounting ISO..."
  23. sudo mount -o loop "$ISO_FILE" "$ISO_MOUNT_DIR"
  24.  
  25. # Check if the mounting was successful
  26. if [[ $? -ne 0 ]]; then
  27. echo "Failed to mount ISO."
  28. exit 1
  29. fi
  30.  
  31. # Run objdump on the ISO contents
  32. echo "Running objdump..."
  33. find "$ISO_MOUNT_DIR" -type f -exec objdump -a {} \;
  34.  
  35. # Unmount the ISO
  36. echo "Unmounting ISO..."
  37. sudo umount "$ISO_MOUNT_DIR"
  38.  
  39. # Remove the mount directory
  40. rmdir "$ISO_MOUNT_DIR"
  41.  
  42. echo "Done."
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement