-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·45 lines (37 loc) · 1.15 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
#!/bin/bash -eu
# Bash installer for tkldev-tools
. lib/bash-common
check_root
deps="devscripts" # includes dch which we leverage for tkldev-changelog
deps="$deps python3-colorama" # required for turnkey-bugs
to_install=""
for dep in $deps; do
dpkg -s $dep >/dev/null 2>&1 || to_install="$to_install $dep"
done
if [[ -n "$to_install" ]]; then
info "Please wait while apt indexes are updated and packages installed."
apt update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y $to_install
fi
SRC_PATH=$PWD
BASE_PATH=/usr/local
BIN_PATH=${BASE_PATH}/bin
LIB_PATH=${BASE_PATH}/lib
ETC_PATH=/etc/tkldev-tools
CONF=${ETC_PATH}/conf
CONF_EX=${SRC_PATH}/etc/conf.example
for file in $(find ${SRC_PATH}/bin -executable -type f); do
ln -fs ${file} ${BIN_PATH}/$(basename ${file})
done
for file in $(find ${SRC_PATH}/lib -type f); do
ln -fs ${file} ${LIB_PATH}/$(basename ${file})
done
mkdir -p ${ETC_PATH}
if [[ ! -f ${CONF} ]]; then
cp ${CONF_EX} ${CONF}
else
if ! diff ${CONF_EX} ${CONF} >/dev/null 2>&1; then
warning "${CONF} already exists, please check that it is compatible with ${CONF_EX}"
fi
fi
info "install complete."