From 2b846c7406de7e84a6abe004489157a8cdaef8fe Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 18 Dec 2013 14:28:51 +0100 Subject: [PATCH] Add quotes around $DISTRO The lsb_release -si output might contain spaces. E.g. on openSUSE it is "openSUSE project". Change-Id: I0e37bab54d0156f484433246bba7cdc686326c86 --- .../os-refresh-config/pre-configure.d/97-fedora-iptables | 2 +- .../geard/os-refresh-config/pre-configure.d/97-gearman-iptables | 2 +- .../os-refresh-config/pre-configure.d/97-gearman-iptables | 2 +- .../os-refresh-config/migration.d/10-bootstrap-mysql | 2 +- .../pre-configure.d/97-fedora-neutron-iptables | 2 +- elements/rabbitmq-server/install.d/20-rabbitmq-server | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/elements/boot-stack/os-refresh-config/pre-configure.d/97-fedora-iptables b/elements/boot-stack/os-refresh-config/pre-configure.d/97-fedora-iptables index b1d4b880b..ebc7b98ab 100755 --- a/elements/boot-stack/os-refresh-config/pre-configure.d/97-fedora-iptables +++ b/elements/boot-stack/os-refresh-config/pre-configure.d/97-fedora-iptables @@ -9,7 +9,7 @@ fi DISTRO=`lsb_release -si` || true -if [[ "Fedora" = $DISTRO ]]; then +if [[ "Fedora" = "$DISTRO" ]]; then # Check if the iptables service is active if systemctl is-active iptables.service ; then diff --git a/elements/geard/os-refresh-config/pre-configure.d/97-gearman-iptables b/elements/geard/os-refresh-config/pre-configure.d/97-gearman-iptables index cb1adb477..5e4ea5fde 100755 --- a/elements/geard/os-refresh-config/pre-configure.d/97-gearman-iptables +++ b/elements/geard/os-refresh-config/pre-configure.d/97-gearman-iptables @@ -9,7 +9,7 @@ fi DISTRO=`lsb_release -si` || true -if [[ "Fedora" = $DISTRO ]]; then +if [[ "Fedora" = "$DISTRO" ]]; then # Check if the iptables service is active if systemctl is-active iptables.service ; then diff --git a/elements/gearman/os-refresh-config/pre-configure.d/97-gearman-iptables b/elements/gearman/os-refresh-config/pre-configure.d/97-gearman-iptables index cb1adb477..5e4ea5fde 100755 --- a/elements/gearman/os-refresh-config/pre-configure.d/97-gearman-iptables +++ b/elements/gearman/os-refresh-config/pre-configure.d/97-gearman-iptables @@ -9,7 +9,7 @@ fi DISTRO=`lsb_release -si` || true -if [[ "Fedora" = $DISTRO ]]; then +if [[ "Fedora" = "$DISTRO" ]]; then # Check if the iptables service is active if systemctl is-active iptables.service ; then diff --git a/elements/mysql-migration/os-refresh-config/migration.d/10-bootstrap-mysql b/elements/mysql-migration/os-refresh-config/migration.d/10-bootstrap-mysql index 5cfc06001..12b2ba102 100755 --- a/elements/mysql-migration/os-refresh-config/migration.d/10-bootstrap-mysql +++ b/elements/mysql-migration/os-refresh-config/migration.d/10-bootstrap-mysql @@ -33,7 +33,7 @@ if [ -e $DONE_FILE ] ; then fi # MySQL may be stopped pre-configuration, so try to start it -if [ -d /etc/init ] && [ $DISTRO = "Ubuntu" ] ; then +if [ -d /etc/init ] && [ "$DISTRO" = "Ubuntu" ] ; then # Upstart: During initial boot, mysql will start in parallel with os-refresh-config # wait-for-state is a job that allows blocking until a particular state is reached. start wait-for-state WAIT_FOR=mysql WAITER=$(basename $0) WAIT_FOREVER=Y TARGET_GOAL=start WAIT_STATE=running diff --git a/elements/neutron/os-refresh-config/pre-configure.d/97-fedora-neutron-iptables b/elements/neutron/os-refresh-config/pre-configure.d/97-fedora-neutron-iptables index 7c0613948..523c0d338 100755 --- a/elements/neutron/os-refresh-config/pre-configure.d/97-fedora-neutron-iptables +++ b/elements/neutron/os-refresh-config/pre-configure.d/97-fedora-neutron-iptables @@ -3,7 +3,7 @@ set -eu # Exit if not Fedora DISTRO=`lsb_release -si` || true -[ "Fedora" != $DISTRO ] && exit 0 +[ "Fedora" != "$DISTRO" ] && exit 0 # Check if the iptables service is active if systemctl is-active iptables.service ; then diff --git a/elements/rabbitmq-server/install.d/20-rabbitmq-server b/elements/rabbitmq-server/install.d/20-rabbitmq-server index 2ab749bab..c6b34c845 100755 --- a/elements/rabbitmq-server/install.d/20-rabbitmq-server +++ b/elements/rabbitmq-server/install.d/20-rabbitmq-server @@ -5,7 +5,7 @@ DISTRO=`lsb_release -si` || true install-packages rabbitmq-server # In Ubuntu rabbit's default init.d script is broken. -if [ x`lsb_release -si 2> /dev/null` = "xUbuntu" ]; then +if [ "$DISTRO" == "Ubuntu" ]; then update-rc.d -f rabbitmq-server remove rm /etc/init.d/rabbitmq-server cat > /etc/init/rabbitmq-server.conf <