-
Notifications
You must be signed in to change notification settings - Fork 24
/
sedutil.vagrant.build.sh
executable file
·47 lines (39 loc) · 2.1 KB
/
sedutil.vagrant.build.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
#!/bin/bash
SKIP=0
which vagrant &> /dev/null
if [ "$?" != 0 ]; then
printf "\nPlease install vagrant.\n\n"
exit 1
fi
which virsh &> /dev/null
if [ "$?" == 0 ] && [ "`virsh version | head -1 | grep --only-matching libvirt`" == "libvirt" ] && [ "`vagrant plugin list | grep --extended-regexp --only-matching \"^vagrant-libvirt\"`" == "vagrant-libvirt" ]; then
vagrant up --provider=libvirt || (printf "\n\n\nBuild attempt failed.\n\n" ; exit 1)
SKIP=1
fi
which vboxmanage &> /dev/null
if [ "$?" == 0 ] && [ "$SKIP" == 0 ]; then
vagrant up --provider=virtualbox || (printf "\n\n\nBuild attempt failed.\n\n" ; exit 1)
SKIP=1
fi
which vmware &> /dev/null
if [ "$?" == 0 ] && [ "$SKIP" == 0 ] && [ "`vmware --version | head -1 | grep --only-matching --extended-regexp \"^VMware Workstation|^VMware Fusion\" | grep --only-matching --extended-regexp \"^VMware\"`" == "VMware" ] && [ "`vagrant plugin list | grep --extended-regexp --only-matching \"^vagrant-vmware-desktop\"`" == "vagrant-vmware-desktop" ]; then
vagrant up --provider=vmware_desktop || (printf "\n\n\nBuild attempt failed.\n\n" ; exit 1)
SKIP=1
fi
which prlctl &> /dev/null
if [ "$?" == 0 ] && [ "$SKIP" == 0 ] && [ "`vagrant plugin list | grep --extended-regexp --only-matching \"^vagrant-parallels\"`" == "vagrant-parallels" ]; then
vagrant up --provider=parallels || (printf "\n\n\nBuild attempt failed.\n\n" ; exit 1)
SKIP=1
fi
if [ "$SKIP" == 0 ] && [ "`vagrant plugin list --debug 2>&1 | grep --extended-regexp --only-matching \"Hyper-V provider\"`" == "Hyper-V provider" ]; then
vagrant up --provider=hyperv || (printf "\n\n\nBuild attempt failed.\n\n" ; exit 1)
SKIP=1
fi
if [ "$SKIP" == 1 ]; then
vagrant ssh-config > config
echo "get sedutil/sedutil-1.16.0.tar.gz sedutil-1.16.0.tar.gz" | sftp -q -F config default
echo "get -r sedutil/images/BIOS32 images/BIOS32" | sftp -q -F config default
echo "get -r sedutil/images/UEFI64 images/UEFI64" | sftp -q -F config default
echo "get -r sedutil/images/RESCUE32 images/RESCUE32" | sftp -q -F config default
echo "get -r sedutil/images/RESCUE64 images/RESCUE64" | sftp -q -F config default
fi