Use socket.gethostbyaddr to define hostname.
This commit is contained in:
parent
3203e4dcd0
commit
4308689b61
@ -1,14 +1,6 @@
|
||||
#!/bin/sh -eux
|
||||
|
||||
dnshost="$(hostname)"
|
||||
if command -v dig >/dev/null
|
||||
then
|
||||
hostip="$(dig +short $(hostname))"
|
||||
if [ -n "${hostip}" ]
|
||||
then
|
||||
dnshost="$(dig +short -x "${hostip}" | sed "s/\(.*\)\./\1/")"
|
||||
fi
|
||||
fi
|
||||
dnshost="$(echo "import socket; print(socket.gethostbyaddr('$(hostname)')[0])" | "$(command -v python3)")"
|
||||
systemctl unmask gssproxy
|
||||
ipa-server-install --hostname=${dnshost} -r EXAMPLE.TEST -n example.test --setup-dns --no-forwarders --allow-zone-overlap -p Secret123 -a Secret123 -U
|
||||
echo Secret123 | kinit admin
|
||||
|
Loading…
Reference in New Issue
Block a user