Skip to content

Instantly share code, notes, and snippets.

@sentient06
Created December 3, 2024 10:11
Show Gist options
  • Save sentient06/336ba40598e06425bf75ab80fab1e779 to your computer and use it in GitHub Desktop.
Save sentient06/336ba40598e06425bf75ab80fab1e779 to your computer and use it in GitHub Desktop.
Classic Macintosh Projects - Script for mounting volume image on QEMU
#!/bin/bash
# Path to your CD-ROM image
CDROM_IMAGE="$1"
# Send commands to QEMU monitor socket
send_monitor_command() {
printf "$1\n" | nc -U /tmp/qemu-monitor.sock
}
# Eject current media (if any)
send_monitor_command "eject -f cd0"
# Insert new media
send_monitor_command "change cd0 $CDROM_IMAGE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment