refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / macos / install.sh
1 #!/bin/bash
2 set -e
3 set -u
4
5 webi_download
6
7 pushd ~/Downloads/webi 2>&1 > /dev/null
8
9 if [ "Darwin" == "$(uname -s)" ]; then
10     curl -fsSL 'https://gist.githubusercontent.com/coolaj86/8c36d132250163011c83bad8284975ee/raw/5a291955813743c20c12ca2d35c7b1bb34f8aecc/create-bootable-installer-for-os-x-el-capitan.sh' -o create-bootable-installer-for-os-x-el-capitan.sh
11     bash create-bootable-installer-for-os-x-el-capitan.sh
12 else
13     curl -fsSL 'https://gist.githubusercontent.com/coolaj86/9834a45a6c21a41e8882698a00b55787/raw/c43061cd0c53ec675996f5cb66c7077e666aabd4/install-mac-tools.sh' -o install-mac-tools.sh
14     # TODO add xar to webinstall.dev
15     sudo apt install libz-dev # needed for xar
16     bash install-mac-tools.sh
17     echo "WARN: may need a restart for hfsplus to be recognized by the kernel"
18
19     curl -fsSL 'https://gist.github.com/coolaj86/04fd06560a8465a695337eb502f5b0e9/raw/0a06fb4dce91399d374d9a12958dabb48a9bd42a/empty.7400m.img.bz2' -o empty.7400m.img.bz2
20
21     curl -fsSL 'https://gist.githubusercontent.com/coolaj86/9834a45a6c21a41e8882698a00b55787/raw/c43061cd0c53ec675996f5cb66c7077e666aabd4/linux-create-bootable-macos-recovery-image.sh' -o linux-create-bootable-macos-recovery-image.sh
22     bash linux-create-bootable-macos-recovery-image.sh
23 fi
24
25 mv ~/Downloads/webi/el-capitan.iso ~/Downloads/
26 echo ""
27 echo "Created ~/Downloads/el-capitan.iso"
28 echo ""
29
30 popd 2>&1 > /dev/null