diff --git a/base_arch/etc/one-context.d/05-hostname b/base_arch/etc/one-context.d/05-hostname index c94549e..60e732b 100755 --- a/base_arch/etc/one-context.d/05-hostname +++ b/base_arch/etc/one-context.d/05-hostname @@ -20,7 +20,7 @@ function get_dns_name() { } if [ -n "$SET_HOSTNAME" ]; then - set_hostname $SET_HOSTNAME + set_hostname $(echo "$SET_HOSTNAME" | sed -e 's/[^-a-zA-Z0-9]/-/g') elif [ -n "$DNS_HOSTNAME" ]; then set_hostname $(get_dns_name) fi diff --git a/base_deb.one/etc/one-context.d/05-hostname b/base_deb.one/etc/one-context.d/05-hostname index c5f9e1d..b0b08c7 100755 --- a/base_deb.one/etc/one-context.d/05-hostname +++ b/base_deb.one/etc/one-context.d/05-hostname @@ -22,7 +22,7 @@ function get_dns_name() { } if [ -n "$SET_HOSTNAME" ]; then - set_hostname $SET_HOSTNAME + set_hostname $(echo "$SET_HOSTNAME" | sed -e 's/[^-a-zA-Z0-9]/-/g') elif [ -n "$DNS_HOSTNAME" ]; then set_hostname $(get_dns_name) fi diff --git a/base_rpm.one/etc/one-context.d/05-hostname b/base_rpm.one/etc/one-context.d/05-hostname index dd43e8d..4532c51 100755 --- a/base_rpm.one/etc/one-context.d/05-hostname +++ b/base_rpm.one/etc/one-context.d/05-hostname @@ -23,7 +23,7 @@ function get_dns_name() { } if [ -n "$SET_HOSTNAME" ]; then - set_hostname $SET_HOSTNAME + set_hostname $(echo "$SET_HOSTNAME" | sed -e 's/[^-a-zA-Z0-9]/-/g') elif [ -n "$DNS_HOSTNAME" ]; then set_hostname $(get_dns_name) fi