forked from max-lobur/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
executable file
·36 lines (29 loc) · 858 Bytes
/
init.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
#!/usr/bin/env bash
if [[ "$OSTYPE" == "darwin"* ]]; then
OS="mac"
elif [ -n "$(uname -a | grep Ubuntu)" ]; then
OS="ubuntu"
elif [ -f /etc/redhat-release ]; then
OS="rhel"
else
echo "Cannot determine the OS"
exit 1
fi
echo "Detected OS: ${OS}"
source ./vars.sh
echo " --------------------------- INIT --------------------------- "
# 1) Dotfiles
for f in $(ls -d $(pwd)/dotfiles/.?* | grep -v "^/.$" | grep -v "/..$"); do
ln -sf $f ~/
done
# 2) OS-specific
for f in $(find ./init/${OS} -maxdepth 1 -not -type d); do
bash ${f}
done
# 3) Commons
bash ./init/common/setup_zsh.sh
bash ./init/common/git_settings.sh
[[ "${OS}" != "mac" ]] && bash ./init/common/ssh_access.sh
read -p "Profile? " profile
[[ $profile ]] && ./profiles/$OS/$profile/install.sh
echo " --------------------------- DONE --------------------------- "