-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·39 lines (32 loc) · 906 Bytes
/
run.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
#!/usr/bin/env bash
set -euo pipefail
DROPBOX_DIR="$HOME/Dropbox"
# Install Homebrew
if ! type "brew" &> /dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if [ -x /usr/local/bin/brew ]; then
eval "$(/usr/local/bin/brew shellenv)"
elif [ -x /opt/homebrew/bin/brew ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
fi
brew doctor
brew update
# Install Dropbox
if ! brew ls --versions --cask dropbox &> /dev/null; then
brew install --cask dropbox
open -a /Applications/Dropbox.app
fi
echo 'Wait for Dropbox to fully sync and press RETURN to continue...'
while IFS='' read -r -s -n 1 -d '' key; do
if [ "${key}" = $'\n' ]; then
break
fi
done
# Install Ansible
if ! type "ansible-playbook" &> /dev/null; then
brew install ansible
fi
# Run
cd "$DROPBOX_DIR/restore/setup/ansible"
ansible-playbook playbook.yml