-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbootstrap.sh
executable file
·32 lines (28 loc) · 1003 Bytes
/
bootstrap.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
#!/usr/local/bin/bash
# NOTE: this only works with Bash 4.0+
# This will take care of two very common errors:
# Referencing undefined variables (that default to "")
# Ignoring failing commands
set -o nounset
set -o errexit
echo -e '\n--- SSH ---'
if [ ! -f ~/.ssh/id_ed25519 ]; then
echo 'setting up SSH key';
ssh-keygen -t ed25519 -C "$(scutil --get ComputerName)"
# WARNING: The -K and -A flags are deprecated and have been replaced
# by the --apple-use-keychain and --apple-load-keychain
# flags, respectively. To suppress this warning, set the
# environment variable APPLE_SSH_ADD_BEHAVIOR as described in
# the ssh-add(1) manual page.
ssh-add ~/.ssh/id_ed25519
else
echo 'SSH key already exists';
fi
echo -e '\n--- Homebrew ---'
if ! command -v brew; then
echo 'installing Homebrew';
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)";
else
echo 'Homebrew already installed';
fi
echo -e '\n--- BOOTSTRAPPING FINISHED ---'