Used set to make shell scripts more strict (#3278)

* Use set to make shell scripts more strict

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>

* Change -o pipefail to -e

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>

* Set scripts to standard rule

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
This commit is contained in:
Owais Kazi 2022-05-16 11:05:13 -07:00 committed by GitHub
parent 4886f8e162
commit e73a410139
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 32 additions and 8 deletions

View File

@ -14,7 +14,7 @@
# when we do rebuild the files they don't jump around too much. That
# way the diffs are smaller.
set -e
set -e -o pipefail
script_path="$( cd "$(dirname "$0")" ; pwd -P )"
work=$(mktemp -d)

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -e -o pipefail
if [ "$#" -eq 0 ]; then
printf 'Usage: %s <origin> <branch> <branch> ...\n' "$(basename "$0")"

View File

@ -1,4 +1,6 @@
#!/bin/sh
#!/usr/bin/env bash
set -e -o pipefail
### Script to check for signoff presents on commits

View File

@ -1,4 +1,6 @@
#!/usr/bin/env bash
set -e -o pipefail
cd /usr/share/opensearch/bin/
/usr/local/bin/docker-entrypoint.sh | tee > /usr/share/opensearch/logs/console.log

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -e -o pipefail
# Files created by Elasticsearch should always be group writable too
umask 0002

View File

@ -10,6 +10,8 @@
# $1=1 : indicates an new install
# $1=2 : indicates an upgrade
set -e -o pipefail
err_exit() {
echo "$@" >&2
exit 1

View File

@ -3,6 +3,8 @@
# This wrapper script allows SystemD to feed a file containing a passphrase into
# the main OpenSearch startup script
set -e -o pipefail
if [ -n "$OPENSEARCH_KEYSTORE_PASSPHRASE_FILE" ] ; then
exec /usr/share/opensearch/bin/opensearch "$@" < "$OPENSEARCH_KEYSTORE_PASSPHRASE_FILE"
else

View File

@ -12,6 +12,8 @@
# Description: Starts opensearch using start-stop-daemon
### END INIT INFO
set -e -o pipefail
PATH=/bin:/usr/bin:/sbin:/usr/sbin
NAME=opensearch
DESC="OpenSearch Server"

View File

@ -16,6 +16,8 @@
# Description: OpenSearch is a very scalable, schema-free and high-performance search solution supporting multi-tenancy and near realtime search.
### END INIT INFO
set -e -o pipefail
#
# init.d / servicectl compatibility (openSUSE)
#

View File

@ -13,6 +13,8 @@
#
# OPENSEARCH_JAVA_OPTS="-Xms8g -Xmx8g" ./bin/opensearch
set -e -o pipefail
source "`dirname "$0"`"/opensearch-env
CHECK_KEYSTORE=true

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -e -o pipefail
OPENSEARCH_MAIN_CLASS=org.opensearch.common.settings.KeyStoreCli \
OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/keystore-cli \
"`dirname "$0"`"/opensearch-cli \

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e -o pipefail
OPENSEARCH_MAIN_CLASS=org.opensearch.cluster.coordination.NodeToolCli \
"`dirname "$0"`"/opensearch-cli \

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -e -o pipefail
OPENSEARCH_MAIN_CLASS=org.opensearch.plugins.PluginCli \
OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/plugin-cli \
"`dirname "$0"`"/opensearch-cli \

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -e -o pipefail
OPENSEARCH_MAIN_CLASS=org.opensearch.index.shard.ShardToolCli \
"`dirname "$0"`"/opensearch-cli \
"$@"

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e -o pipefail
OPENSEARCH_MAIN_CLASS=org.opensearch.upgrade.UpgradeCli \
OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/upgrade-cli \

View File

@ -1,4 +1,6 @@
#!/usr/bin/env bash
set -e -o pipefail
cd /usr/share/opensearch/bin/
./opensearch-users useradd rest_user -p test-password -r superuser || true
echo "testnode" > /tmp/password

View File

@ -17,7 +17,7 @@
# specific language governing permissions and limitations
# under the License.
set -e
set -e -o pipefail
krb5kdc
kadmind

View File

@ -10,7 +10,7 @@
# GitHub history for details.
#
set -e
set -e -o pipefail
addprinc.sh "opensearch"
#TODO(OpenSearch): fix username

View File

@ -29,7 +29,7 @@
# GitHub history for details.
#
set -e
set -e -o pipefail
# KDC installation steps and considerations based on https://web.mit.edu/kerberos/krb5-latest/doc/admin/install_kdc.html
# and helpful input from https://help.ubuntu.com/community/Kerberos

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
set -e -o pipefail
addprinc.sh opensearch
addprinc.sh HTTP/localhost