summaryrefslogtreecommitdiff
path: root/setup-alpine.in
diff options
context:
space:
mode:
authorLukas Bestle <mail@lukasbestle.com>2021-07-09 22:48:26 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2021-11-16 11:31:51 +0000
commit861b70fc2fefc7717cd7de1dafb118176aca846b (patch)
tree4a13b9d36298d2ca743c34ce62151018f146f4d9 /setup-alpine.in
parentc38223ed80efed2a5e91134250868f6cc6c93499 (diff)
downloadalpine-conf-861b70fc2fefc7717cd7de1dafb118176aca846b.zip
setup-dns: Use FQDN from hostname as domain
Diffstat (limited to 'setup-alpine.in')
-rw-r--r--setup-alpine.in12
1 files changed, 1 insertions, 11 deletions
diff --git a/setup-alpine.in b/setup-alpine.in
index 4ffae48..3c4d2da 100644
--- a/setup-alpine.in
+++ b/setup-alpine.in
@@ -6,16 +6,6 @@ VERSION=@VERSION@
PREFIX=
. $PREFIX/lib/libalpine.sh
-# Extract fully qualified domain name from current hostname. If none is
-# currently set, use 'my.domain'.
-get_fqdn() {
- local _dn
- _dn=$(hostname -f 2>/dev/null)
- _dn=${_dn#$(hostname -s 2>/dev/null)}
- _dn=${_dn#.}
- echo "${_dn:=my.domain}"
-}
-
is_qemu() {
grep -q "QEMU" /proc/cpuinfo \
|| strings /sys/firmware/dmi/tables/DMI 2>/dev/null | grep -q QEMU
@@ -175,7 +165,7 @@ _dn=$(sed -n \
_hn=$(hostname)
_hn=${_hn%%.*}
-sed -i -e "s/^127\.0\.0\.1.*/127.0.0.1\t${_hn}.${_dn:-$(get_fqdn)} ${_hn} localhost.localdomain localhost/" /etc/hosts
+sed -i -e "s/^127\.0\.0\.1.*/127.0.0.1\t${_hn}.${_dn:-$(get_fqdn my.domain)} ${_hn} localhost.localdomain localhost/" /etc/hosts
if [ -z "$quick" ]; then
$PREFIX/sbin/setup-proxy -q ${PROXYOPTS}