Arbitrary file copy to remote disk

This commit is contained in:
Elliot Nunn 2019-07-28 16:12:38 +08:00
parent 00a3db5bf0
commit 9ec6321412

View File

@ -1,9 +1,19 @@
#!/bin/bash #!/bin/bash
REMOTE_DISK_NAME=Alpha REMOTE=/Volumes/Alpha
until mount | grep -q "/Volumes/$REMOTE_DISK_NAME"; do sleep 0.15; done echo -n Waiting for "$REMOTE"...
rm -f "/Volumes/$REMOTE_DISK_NAME/System Folder/Mac OS ROM" until mount | grep -q "$REMOTE"; do sleep 0.15; done
binhex -o "/Volumes/$REMOTE_DISK_NAME/System Folder/Mac OS ROM" $< echo ok
diskutil unmountDisk force /dev/`diskutil info /Volumes/Alpha/ | grep "Part of Whole" | sed 's/.*:\s*//'`
for x in "$@"; do
td="$(mktemp -d)"
binhex -C "$td" "$x" # hack to find out file name!
rm -f "$REMOTE/System Folder/$(ls "$td")"
rm -rf "$td"
binhex -C "$REMOTE/System Folder/" "$x"
done
diskutil unmountDisk force /dev/`diskutil info "$REMOTE" | grep "Part of Whole" | tr '[[:space:]]' '\n' | tail -n1`
echo -n -e "\a"
say copied say copied