1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2025-12-15 11:22:43 +03:00

add STDERR output for problems with set_hostname

This commit is contained in:
Jake Buchholz Göktürk 2023-05-09 04:13:21 +00:00
parent de66c6049e
commit 229fc70b42

View File

@ -199,13 +199,15 @@ init__enable_sshd() {
init__set_hostname() {
local fqdn=$(imds @hostname)
if [ -z "$fqdn" ]; then
echo "no hostname set" >&2
log info "No hostname set"
return
fi
local host="${fqdn%%\.*}"
if [ -z "$host" ]; then
log err "$fqdn is not a valid hostname"
echo "$hostname is not a valid FQDN" >&2
log err "$fqdn is not a valid FQDN"
return 1
fi