diff --git a/base_arch/etc/one-context.d/05-hostname b/base_arch/etc/one-context.d/05-hostname index c94549e..d401dd0 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' -e 's/^-*//g' -e 's/-*$//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..92bcc76 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' -e 's/^-*//g' -e 's/-*$//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..df77aa0 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' -e 's/^-*//g' -e 's/-*$//g') elif [ -n "$DNS_HOSTNAME" ]; then set_hostname $(get_dns_name) fi