summaryrefslogtreecommitdiff
path: root/scripts/rabbitmqctl
diff options
context:
space:
mode:
authorGerhard Lazu <gerhard@users.noreply.github.com>2017-01-18 17:07:23 +0000
committerGitHub <noreply@github.com>2017-01-18 17:07:23 +0000
commitd8fd7d3f04b9e42513dd493c91167039076e75f3 (patch)
tree44d72b2a7ba2ee2f6c6a65e2ac5b1d1db099adf8 /scripts/rabbitmqctl
parentbfff36ea6517bcb478534001a0430f5e58149666 (diff)
parent5c239b0618333f4d4f140012e90cc61fc5139799 (diff)
downloadrabbitmq-server-git-d8fd7d3f04b9e42513dd493c91167039076e75f3.tar.gz
Merge pull request #1084 from rabbitmq/use-sh-for-scripts
Modify new scripts to use /bin/sh
Diffstat (limited to 'scripts/rabbitmqctl')
-rwxr-xr-xscripts/rabbitmqctl31
1 files changed, 28 insertions, 3 deletions
diff --git a/scripts/rabbitmqctl b/scripts/rabbitmqctl
index 048062b00d..49519c7025 100755
--- a/scripts/rabbitmqctl
+++ b/scripts/rabbitmqctl
@@ -1,7 +1,32 @@
-#!/usr/bin/env bash
+#!/bin/sh
+## The contents of this file are subject to the Mozilla Public License
+## Version 1.1 (the "License"); you may not use this file except in
+## compliance with the License. You may obtain a copy of the License
+## at http://www.mozilla.org/MPL/
+##
+## Software distributed under the License is distributed on an "AS IS"
+## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+## the License for the specific language governing rights and
+## limitations under the License.
+##
+## The Original Code is RabbitMQ.
+##
+## The Initial Developer of the Original Code is GoPivotal, Inc.
+## Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
+##
+# Exit immediately if a pipeline, which may consist of a single simple command,
+# a list, or a compound command returns a non-zero status
+set -e
+
+# Each variable or function that is created or modified is given the export
+# attribute and marked for export to the environment of subsequent commands.
set -a
-. `dirname $0`/rabbitmq-env
+# shellcheck source=/dev/null
+#
+# TODO: when shellcheck adds support for relative paths, change to
+# shellcheck source=./rabbitmq-env
+. "${0%/*}"/rabbitmq-env
-escript $ESCRIPT_DIR/rabbitmqctl "$@"
+escript "${ESCRIPT_DIR:?must be defined}"/rabbitmqctl "$@"