File lbdb-hostname.diff of Package lbdb
--- b/lbdb_lib.sh.in 2019-01-07 19:30:29.000000000 +0100
+++ a/lbdb_lib.sh.in 2020-05-06 10:13:38.987327900 +0200
@@ -56,11 +56,8 @@
else
hn=""
if test -r /etc/resolv.conf ; then
- hn="$(sed -n -e 's/^[ ]*domain[ ]\{1,\}\([^ ]*\)/\1/p' /etc/resolv.conf)"
- if test "x$hn" = "x" ; then
- hn="$(sed -n -e 's/^[ ]*search[ ]\{1,\}\([^ ]*\)/\1/p' /etc/resolv.conf)"
- fi
- fi
+ hn=`awk '/^#/{next}($1 == "search" || $1 == "domain" ) && $2 != "" {print $2;exit}' < /etc/resolv.conf`
+ fi
if test "x$hn" = "x" ; then
hn=$(lbdb_hn_sendmail)
if test "x$hn" = "xNONE" ; then