From caa6ab3e221650c22e6fd8907d1451ba531325f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Mon, 9 Sep 2013 14:12:54 +0300 Subject: [PATCH] puppet: Fixed bootstrap-server.sh for OpenBSD. --- puppet/bootstrap-server.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/puppet/bootstrap-server.sh b/puppet/bootstrap-server.sh index 485b813..aaa73f5 100755 --- a/puppet/bootstrap-server.sh +++ b/puppet/bootstrap-server.sh @@ -11,10 +11,16 @@ case $1 in ;; esac -hostname -f | fgrep "." > /dev/null -if [ $? -ne 0 ]; then - echo "error, command 'hostname -f' does not return domainname" 1>&2 - exit 1 +hostname | fgrep "." > /dev/null +if [ $? -eq 0 ]; then + FQDN="$(hostname)" +else + hostname -f | fgrep "." > /dev/null + if [ $? -ne 0 ]; then + echo "error, command 'hostname -f' does not return domainname" 1>&2 + exit 1 + fi + FQDN="$(hostname -f)" fi which ruby > /dev/null 2>&1 @@ -33,8 +39,7 @@ if [ -s /etc/puppet/puppet.conf ]; then mv /etc/puppet/puppet.conf /etc/puppet/puppet.conf.orig fi -FQDN="$(hostname -f)" - +mkdir -p /srv mkdir -p /etc/puppet/manifests/node if [ ! -s /etc/puppet/manifests/site.pp ]; then