Cider Isn't Darwin Emulation, Really
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859#!/bin/sh# helper functions# errcho - a variant of echo that prints to stderrerrcho() { >&2 echo "$@"}# subcommandseject() { if [ "$#" -lt 1 ]; then errcho "Usage: diskutil eject MountPoint|DiskIdentifier|DeviceNode" exit 1 fi DISK_PATH=$1 shift; if [ ! -e "$DISK_PATH" ]; then errcho "Unable to find disk for $DISK_PATH" exit 1 fi if ! hdiutil detach "$DISK_PATH" > /dev/null 2>&1; then errcho "Unmount of $DISK_PATH failed: at least one volume could not be unmounted" exit 1 fi echo "Disk $DISK_PATH ejected"}if [ "$#" -lt 1 ]; then >&2 cat <<- 'EOF' Disk Utility Tool Utility to manage local disks and volumes Most commands require an administrator or root user WARNING: Most destructive operations are not prompted eject (Eject a disk) EOF exit 1fiVERB="$1"shift;case "$VERB" in eject) eject "$@" ;; *) errcho "diskutil: did not recognize verb \"$VERB\"; type \"diskutil\" for a list" exit 1 ;;esac