Neat new script for copying to HFS Standard volumes

This commit is contained in:
Elliot Nunn 2019-10-03 15:47:29 +08:00
parent 57ac21ae75
commit a2dfc8d98d
1 changed files with 23 additions and 0 deletions

23
autocopystd.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
REMOTE=Alpha
sudo true # get password out of way
echo -n Waiting for "$REMOTE"...
while [ -z "$DEVNODE" ]; do
DEVNODE="$(diskutil list external | grep "$REMOTE" | head -n1 | awk '{print $NF}')"
if [ -z "$DEVNODE" ]; then sleep 0.15; fi
done
DEVNODE="/dev/$DEVNODE"
sudo diskutil unmountDisk $DEVNODE
sudo hmount $DEVNODE
for x in "$@"; do
sudo hcopy "$x" ':System Folder:'
done
humount
sync
echo -n -e "\a"
say copied