forked from daemonza/setupmac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
executable file
·50 lines (37 loc) · 1.07 KB
/
start.sh
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
#!/bin/bash
# script to bootstrap setting up a mac with ansible
function uninstall {
echo "WARNING : This will remove homebrew and all applications installed through it"
echo -n "are you sure you want to do that? [y/n] : "
read confirmation
if [ $confirmation == "y" ]; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
exit 0
else
echo "keeping everything intact"
exit 0
fi
}
if [ $1 == "uninstall" ]; then
uninstall
fi
echo "==========================================="
echo "Setting up your mac using daemonza/setupmac"
echo "==========================================="
sudo easy_install pip
sudo easy_install ansible
installdir="/tmp/setupmac-$RANDOM"
mkdir $installdir
git clone https://github.com/xyleth/setupmac.git $installdir
if [ ! -d $installdir ]; then
echo "failed to find setupmac."
echo "git cloned failed"
exit 1
else
cd $installdir
ansible-playbook -i ./hosts playbook.yml --verbose
fi
echo "cleaning up..."
rm -Rfv /tmp/$installdir
echo "and we are done! Enjoy!"
exit 0