-
Notifications
You must be signed in to change notification settings - Fork 2
/
sync
executable file
·25 lines (20 loc) · 950 Bytes
/
sync
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
cd ~/ece391ForMac
echo "Mounting Shared Volumes..."
./mount391
userdir=$(cd ~ ;pwd)
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"${MY_PATH}\" && pwd )`" # absolutized and normalized
if [ -z "${MY_PATH}" ] ; then
echo "error; for some reason, the path is not accessible"
echo "to the script (e.g. permissions re-evaled after suid)"
exit 1 # fail
fi
dev_old_path=$("${MY_PATH}"/cowhacker/cowhacker patch "${userdir}"/ece391ForMac/ece391/work/vm/devel.qcow)
test_old_path=$("${MY_PATH}"/cowhacker/cowhacker patch "${userdir}"/ece391ForMac/ece391/work/vm/test.qcow)
unison ~/ece391_Team/ ~/ece391ForMac/ece391/work/ -fat
"${MY_PATH}"/cowhacker/cowhacker revert "${userdir}"/ece391ForMac/ece391/work/vm/devel.qcow "$dev_old_path"
"${MY_PATH}"/cowhacker/cowhacker revert "${userdir}"/ece391ForMac/ece391/work/vm/test.qcow "$test_old_path"
cd ~/ece391ForMac
echo "Unmounting Shared Volumes..."
./unmount391