-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstart
executable file
·62 lines (48 loc) · 2.19 KB
/
start
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
echo "Welcome to ece391 setup for OS X"
echo "Yifei Teng, Yu Wang, Han Yan, Brett Jackson"
echo "Special Thanks for our TA Fei Deng"
homebrew_check=$(which brew)
wget_check=$(which wget)
userdir=$(cd ~ ;pwd)
unison_check=$(which unison)
if [ "${homebrew_check}" == "" ]; then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
if [ "${wget_check}" == "" ]; then
echo "Installing wget..."
brew install wget
fi
if [ "${unison_check}" == "" ]; then
echo "Installing unison..."
brew install unison
cp default.prf ~/Library/Application\ Support/Unison/
fi
# download the main img
if [ ! -f "ece391.tar.gz" ];then
wget "http://duke8253.net/ece391/ece391.tar.gz"
fi
if [ ! -d "ece391" ]; then
tar xzvf ece391.tar.gz
echo "Unzip finished"
else
echo "Folder ece391 already exists"
fi
cp setup_mac ./ece391/setup_mac
cd ece391
./setup_mac #setup for mac
cd ../
# create shortcut command
echo '#!/bin/bash' | sudo tee -a /usr/local/bin/ece391.test >/dev/null
echo "qemu-system-i386 -hda ~/ece391ForMac/ece391/work/vm/test.qcow -no-kvm -kernel ~/ece391ForMac/ece391/work/source/linux-2.6.22.5/bzImage -m 512 -gdb tcp:127.0.0.1:1234 -S -name test" | sudo tee -a /usr/local/bin/ece391.test >/dev/null
echo '#!/bin/bash' | sudo tee -a /usr/local/bin/ece391.dev >/dev/null
echo "qemu-system-i386 -hda ~/ece391ForMac/ece391/work/vm/devel.qcow -net nic -net user,smb=${userdir}/ece391ForMac/ece391/work -m 768 -name devel -redir tcp:2222::22" | sudo tee -a /usr/local/bin/ece391.dev >/dev/null
echo '#!/bin/bash' | sudo tee -a /usr/local/bin/ece391.ssh >/dev/null
echo "ssh -p 2222 user@localhost" | sudo tee -a /usr/local/bin/ece391.ssh >/dev/null
# echo '#!/bin/bash' > /usr/local/bin/ece391.sync
# echo "unison ~/ece391_Team/ ~/ece391ForMac/ece391/work/ -fat" >> /usr/local/bin/ece391.sync
# echo '#!/bin/bash' > /usr/local/bin/ece391.syncvm
# echo "unison ~/ece391_Team/vm ~/ece391ForMac/ece391/work/vm -fat" >> /usr/local/bin/ece391.syncvm
sudo chmod a+x /usr/local/bin/ece391.test /usr/local/bin/ece391.dev /usr/local/bin/ece391.ssh #/usr/local/bin/ece391.sync /usr/local/bin/ece391.syncvm
# end create shortcut