-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-dev-server.sh
executable file
·93 lines (61 loc) · 1.6 KB
/
setup-dev-server.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
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
MYHOME=${HOME}
BASE=`pwd`
DEFAULT_DIR=${BASE}"/defaults"
DISTRO_DIR=${BASE}"/distros"
FINALIZE_DIR=${BASE}"/finalize"
BIN_DIR=${BASE}"/bin"
install_default_configs () {
cp ${DEFAULT_DIR}/vimrc ${MYHOME}/.vimrc
cat ${DEFAULT_DIR}/bashrc | while read LINE; do
grep "$LINE" ${MYHOME}/.bashrc &>/dev/null
if [ $? -ne 0 ]; then
echo "${LINE}" >>${MYHOME}/.bashrc
fi
done
}
fix_git_settings () {
git config --global user.name "Second Hans"
git config --global user.email knikkerr@gmail.com
git config --global credential.helper 'cache --timeout=7200'
}
install_binaries () {
if [ ! -d ${MYHOME}/bin ]; then
mkdir ${MYHOME}/bin
fi
cp -a ${BIN_DIR}/* ${MYHOME}/bin
}
pre_setup_steps () {
echo "---> STEP: pre-setup steps"
install_default_configs
fix_git_settings
install_binaries
echo "---> DONE"
echo
}
distro_specific_setup () {
echo "---> STEP: starting distro specific install"
echo -n "checking if this is a Debian installation ... "
DISTRO="unknown"
if [ -f /etc/debian_version ]; then
echo "yes."
DISTRO="debian"
else
echo "no"
fi
case "${DISTRO}" in
debian ) ${DISTRO_DIR}/setup-dev-debian.sh;;
* ) echo "unknown distro!";;
esac
}
post_setup_steps () {
echo "---> STEP: post-setup steps"
echo "you can manually install/finalize the following scripts:"
find finalize/ -type f -executable
echo "---> DONE"
echo
}
### MAIN
pre_setup_steps
distro_specific_setup
post_setup_steps