-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
51 lines (35 loc) · 1023 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
function setupDirectories() {
PROJECTS_DIR="${HOME}/Projects"
DOTFILES_DIR="${PROJECTS_DIR}/dotfiles"
echo -e "Setting up directories..."
echo -e "\tProjects:\t${PROJECTS_DIR}"
mkdir -p ${PROJECTS_DIR}
}
function setupXClip() {
sudo dnf -y install xclip
}
function setupSSHKeys() {
if [ ! -f "${HOME}/.ssh/id_rsa" ]; then
read -p "Enter email for Github SSH key": GITHUB_EMAIL
ssh-keygen -t rsa -b 4096 -C "${GITHUB_EMAIL}"
# Start SSH-Agent
eval "$(ssh-agent -s)"
# Add key
ssh-add "${HOME}/.ssh/id_rsa"
fi
xclip -sel clip < "${HOME}/.ssh/id_rsa.pub"
read -p "Public key is coppied to the clipboard, press enter to continue"
}
function cloneRepo() {
echo -e "\nCloning dotfiles..."
git clone [email protected]:svenvNL/dotfiles.git ${DOTFILES_DIR}
}
function runSetup() {
bash "${DOTFILES_DIR}/setup.sh"
}
setupDirectories
setupXClip
setupSSHKeys
cloneRepo
runSetup