-
Notifications
You must be signed in to change notification settings - Fork 399
/
Copy pathdropbear.sh
executable file
·60 lines (45 loc) · 1.15 KB
/
dropbear.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
#!/usr/bin/env bash
set -x
set -euo pipefail
# shellcheck disable=SC1091
. lib.sh
main() {
local version=2022.82
local mirrors=(
"https://matt.ucc.asn.au/dropbear/releases"
"https://mirror.dropbear.nl/mirror"
)
install_packages \
autoconf \
automake \
bzip2 \
curl \
make
if_centos install_packages zlib-devel
if_ubuntu install_packages zlib1g-dev
local td
td="$(mktemp -d)"
pushd "${td}"
download_mirrors "" "dropbear-${version}.tar.bz2" "${mirrors[@]}"
tar --strip-components=1 -xjf "dropbear-${version}.tar.bz2"
# Remove some unwanted message
sed -i '/skipping hostkey/d' cli-kex.c
sed -i '/failed to identify current user/d' cli-runopts.c
./configure \
--disable-syslog \
--disable-shadow \
--disable-lastlog \
--disable-utmp \
--disable-utmpx \
--disable-wtmp \
--disable-wtmpx \
--disable-pututline \
--disable-pututxline
make "-j$(nproc)" PROGRAMS=dbclient
cp dbclient /usr/local/bin/
purge_packages
popd
rm -rf "${td}"
rm "${0}"
}
main "${@}"