-
Notifications
You must be signed in to change notification settings - Fork 2
/
entrypoint
executable file
·47 lines (34 loc) · 867 Bytes
/
entrypoint
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
#!/bin/bash -l
set -e
function report {
local title="$1"
echo -e "
$1:
ip: $(get-ipv4)
hostname: $(/bin/hostname)
short: $(/bin/hostname -s)
fqdn: $(/bin/hostname -f)
all-fqdns: $(/bin/hostname -A)
domainname: $(/bin/domainname)
dnsdomainname: $(/bin/dnsdomainname)
HOSTNAME: $HOSTNAME
"
echo '/etc/hostname'
cat /etc/hostname
echo
echo '/etc/hosts'
cat /etc/hosts
echo
}
make
make install
report 'before enable'
# export LD_PRELOAD=/usr/local/lib/liboverridehostname.so.1 OVERRIDE_HOSTNAME=true
eval $(kube-hostname-fix enable)
report 'after enable'
eval $(kube-hostname-fix disable)
report 'after disable'
[[ $STAY_UP == true ]] && tail -f /dev/null
# For some reason without set +e it will return 1 even with exit 0
set +e
exit 0