bbb-pre-install.sh: adjust /etc/hosts to support fqdn hostname.

This commit is contained in:
Christoph 2020-03-28 00:23:30 +01:00
parent bb0a72976f
commit bc8d28d7cb

View File

@ -11,6 +11,9 @@ log_file="${LOCK_DIR}/${script_name%%.*}.log"
DIST="ubuntu" DIST="ubuntu"
DIST_RELEASE="xenial" DIST_RELEASE="xenial"
FQDN_HOSTNAME="bbb.oopen.de"
HOSTNAME=" ${FQDN_HOSTNAME%%.*}"
# ---------- # ----------
# Base Function(s) # Base Function(s)
@ -173,6 +176,18 @@ else
echo_ok echo_ok
fi fi
echononl "Set FQDN hostname (IPv4).."
perl -i -n -p -e "s/^127\.0\.1\.1.*/127.0.1.1 $FQDN_HOSTNAME $HOSTNAME/" /etc/hosts > "$log_file" 2>&1
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
else
echo_ok
fi
exit
blank_line blank_line
echononl "Create sources.list for '$DIST $DIST_RELEASE'.." echononl "Create sources.list for '$DIST $DIST_RELEASE'.."