Merge pull request #28 from jamtaylo/replace-unsafe-chars-in-hostname

Replace unsafe characters in SET_HOSTNAME.
pull/31/head
Javi Fontan 9 years ago
commit b2f3c9ed05

@ -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

@ -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

@ -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

Loading…
Cancel
Save