-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathinstall.sh
executable file
·82 lines (68 loc) · 2.08 KB
/
install.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
#
function install_zsh_centos7() {
sudo yum update -y
sudo yum install -y git make ncurses-devel gcc autoconf man
git clone -b zsh-5.7.1 https://github.com/zsh-users/zsh.git /tmp/zsh
(
cd /tmp/zsh
./Util/preconfig
./configure
sudo make -j 20 install.bin install.modules install.fns
)
}
export BASE_DIR="$(cd "$(dirname $0)" && pwd)"
git config --global pager.branch false
git config --global push.default current
[ ! -d "${HOME}/git" ] && mkdir -p "${HOME}/git"
# skip login check for sshd
touch "${HOME}/.gitenv.nologin"
# vim
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
vim +'PlugInstall --sync' +qall
[ ! -s "${HOME}/opt" ] && ln -s "${BASE_DIR}/opt" "${HOME}/opt"
for file in $(find "${BASE_DIR}/opt/profiles" -type f); do
echo "Creating symlink to $file in home directory."
[ ! -s "${HOME}/$(basename "${file}")" ] && ln -s "${file}" "${HOME}/$(basename "${file}")"
done
# force a few
for file in ".profile" ".zshrc" ".bash_logout" ".bashrc"; do
[ -f "${HOME}/${file}" ] && rm -f "${HOME}/${file}"
ln -s "${BASE_DIR}/opt/profiles/${file}" "${HOME}/${file}"
done
if command -v apt-get &> /dev/null; then
sudo apt-get install -y \
corkscrew \
htop \
iputils-ping \
jq \
lsof \
net-tools \
psmisc \
zsh
fi
# yum script
if command -v yum &> /dev/null; then
sudo yum install -y \
htop \
jq \
lsof \
net-tools \
psmisc \
install_zsh_centos7
fi
# only setup these scripts when docker is installed
if command -v docker &> /dev/null; then
if docker --version 2>&1 >/dev/null; then
[ ! -f "${HOME}/.ruby.env" ] && source "${HOME}/opt/bin/setup_ruby-docker.sh"
[ ! -f "${HOME}/.dindcenv" ] && source "${HOME}/opt/bin/setup_dindc_alias.sh"
fi
fi
# don't bother installing without corkscrew
if command -v corkscrew &> /dev/null; then
[ ! -f "${HOME}/.gitenv" ] && source "${HOME}/opt/bin/setup_git_alias.sh"
fi
if [ -f "${HOME}/.gitrepos" ] ; then
cd "${HOME}"
"${HOME}/.gitrepos"
fi