Skip to content

Commit

Permalink
common: Fix postinst to append "localdomain" to unqualified hostnames
Browse files Browse the repository at this point in the history
Closes #57
  • Loading branch information
Patrick J Cherry committed Sep 1, 2017
1 parent 3fd53e1 commit 6970e92
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions common/debian/postinst
Expand Up @@ -62,6 +62,13 @@ if [ -z "$HOSTNAME" ] ; then
fi
fi

#
# Append ".localdomain" if HOSTNAME has no dots.
#
if ! [[ "$HOSTNAME" =~ ^[_a-z0-9-]+\.([_a-z0-9-]+\.?)+$ ]] ; then
HOSTNAME="$HOSTNAME.localdomain"
fi

#
# If there are no existing directories beneath /srv/ create a default.
#
Expand Down

0 comments on commit 6970e92

Please sign in to comment.