mirror of
https://github.com/elliotnunn/tbxi-patches.git
synced 2024-12-12 05:29:48 +00:00
Arbitrary file copy to remote disk
This commit is contained in:
parent
00a3db5bf0
commit
9ec6321412
20
autocopy.sh
20
autocopy.sh
@ -1,9 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
REMOTE_DISK_NAME=Alpha
|
||||
REMOTE=/Volumes/Alpha
|
||||
|
||||
until mount | grep -q "/Volumes/$REMOTE_DISK_NAME"; do sleep 0.15; done
|
||||
rm -f "/Volumes/$REMOTE_DISK_NAME/System Folder/Mac OS ROM"
|
||||
binhex -o "/Volumes/$REMOTE_DISK_NAME/System Folder/Mac OS ROM" $<
|
||||
diskutil unmountDisk force /dev/`diskutil info /Volumes/Alpha/ | grep "Part of Whole" | sed 's/.*:\s*//'`
|
||||
echo -n Waiting for "$REMOTE"...
|
||||
until mount | grep -q "$REMOTE"; do sleep 0.15; done
|
||||
echo ok
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user