forked from mazaclub/EasyGitianBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdarwin-Base-System.sh
More file actions
executable file
·78 lines (68 loc) · 2.76 KB
/
darwin-Base-System.sh
File metadata and controls
executable file
·78 lines (68 loc) · 2.76 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# Copyright (c) 2017 MAZA Network Developers, Robert Nelson (guruvan)
## This script runs on the host machine
# First install Virtualbox and Vagrant
# Vagrant
get_vagrant () {
# Get files
curl -O https://releases.hashicorp.com/vagrant/2.0.0/vagrant_2.0.0_x86_64.dmg
curl -O https://releases.hashicorp.com/vagrant/2.0.0/vagrant_2.0.0_SHA256SUMS
curl -O https://releases.hashicorp.com/vagrant/2.0.0/vagrant_2.0.0_SHA256SUMS.sig
# Verify shasums signature via gpg
gpg --recv-keys 51852D87348FFC4C || exit 9
gpg --verify vagrant_2.0.0_SHA256SUMS.sig vagrant_2.0.0_SHA256SUMS || exit 8
# Verify shasum for download
grep dmg vagrant_2.0.0_SHA256SUMS | shasum -c || exit 7
# Mount the dmg and open it
hdiutil attach vagrant_2.0.0_x86_64.dmg -autoopen
# User must install the app
echo "Now drag the Vagrant icon to the Applications folder"
read -n 1 -s -r -p "Press any key to continue";echo
which vagrant || not_installed vagrant
touch .vagrant_installed
}
# Virtualbox
get_vbox () {
# Get files
curl -O http://download.virtualbox.org/virtualbox/5.1.28/VirtualBox-5.1.28-117968-OSX.dmg
curl -O http://download.virtualbox.org/virtualbox/5.1.28/Oracle_VM_VirtualBox_Extension_Pack-5.1.28-117968.vbox-extpack
curl -O https://www.virtualbox.org/download/hashes/5.1.28/SHA256SUMS
# Verify shasum for download
grep dmg SHA256SUMS | shasum -c || exit 6
grep "117968.vbox-extpack" SHA256SUMS | shasum -c || exit 5
# Mount the dmg and open it
hdiutil attach VirtualBox-5.1.28-117968-OSX.dmg -autoopen
# User must install the app
echo "Now drag the VirtualBox icon to the Applications folder"
read -n 1 -s -r -p "Press any key to continue";echo
which VBoxManage || not_installed VBoxManage
echo "Installing VirtualBox Extension Pack (required)"
sleep 5
extpack_installed=$(VBoxManage list extpacks |grep "Usable" | awk '{print $2}')
if [ "$extpack_installed" != "true" ] ; then
VBoxManage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-5.1.28-117968.vbox-extpack
fi
touch .Vbox_installed
}
not_installed () {
(( attempts++ ))
if [ ${attempts} -le 3 ]; then
echo "Attempting to install ${1} - ${attempts} tries"
which "$1" || get_"${1}"
else
echo "Installation of ${1} failed"
test -f ./.Vbox_installed && echo "VirtualBox seems installed"
test -f ./.vagrant_installed && echo "Vagrant seems installed"
echo " "
echo "If both Virtualbox and Vagrant seem installed, and you still see this message"
echo "Please report an issue on https://github.com/mazaclub/EasyGitianBuilder"
echo " "
echo "You may attempt to install ${1} on your own and run EasyGitian later"
exit 99
fi
}
attempts=1
which vagrant || get_vagrant
which VBoxManage || get_vbox
which vagrant && which VBoxManage && touch .prereq_install_complete
echo "Prerequisites should now be installed"