aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2021-06-28 12:11:06 +0000
committerGerrit Code Review <gerrit@onap.org>2021-06-28 12:11:06 +0000
commitae7b05560d7c7d59c7ceaa7d7e40bdce67e7d399 (patch)
treef9b9f59c9eca920363beb55c0ecde823c94b5018
parent38a5a0decaaf9d4a0ae179432528899b73f1587a (diff)
parent3091ed446f8608e096462b8878333aab4bd27864 (diff)
Merge changes from topic "bashisms"
* changes: [COMMON] Fix array variables increments [COMMON] Fix some bashisms
-rw-r--r--docs/master_nfs_node.sh4
-rw-r--r--docs/openstack-k8s-controlnode.sh8
-rw-r--r--docs/openstack-k8s-workernode.sh8
-rw-r--r--docs/openstack-nfs-server.sh8
-rwxr-xr-xkubernetes/helm/plugins/deploy/deploy.sh2
-rwxr-xr-xkubernetes/helm/plugins/undeploy/undeploy.sh2
-rw-r--r--kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh18
-rwxr-xr-xkubernetes/robot/demo-k8s.sh2
-rwxr-xr-xkubernetes/robot/ete-k8s.sh2
-rwxr-xr-xkubernetes/robot/eteHelm-k8s.sh2
-rwxr-xr-xkubernetes/sdnc/components/sdnc-prom/resources/bin/ensureSdncActive.sh2
-rwxr-xr-xkubernetes/sdnc/components/sdnc-prom/resources/bin/ensureSdncStandby.sh4
-rwxr-xr-xkubernetes/sdnc/resources/geo/bin/switchVoting.sh4
13 files changed, 33 insertions, 33 deletions
diff --git a/docs/master_nfs_node.sh b/docs/master_nfs_node.sh
index 4a7a8dbc12..32574c9f29 100644
--- a/docs/master_nfs_node.sh
+++ b/docs/master_nfs_node.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
usage () {
echo "Usage:"
@@ -23,7 +23,7 @@ sudo chown nobody:nogroup /dockerdata-nfs/
#Update the /etc/exports
NFS_EXP=""
for i in $@; do
- NFS_EXP+="$i(rw,sync,no_root_squash,no_subtree_check) "
+ NFS_EXP="${NFS_EXP}$i(rw,sync,no_root_squash,no_subtree_check) "
done
echo "/dockerdata-nfs "$NFS_EXP | sudo tee -a /etc/exports
diff --git a/docs/openstack-k8s-controlnode.sh b/docs/openstack-k8s-controlnode.sh
index cd219aa56f..d1515a7e5f 100644
--- a/docs/openstack-k8s-controlnode.sh
+++ b/docs/openstack-k8s-controlnode.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
DOCKER_VERSION=18.09.5
@@ -18,10 +18,10 @@ systemctl daemon-reload
systemctl restart docker
apt-mark hold docker-ce
-IP_ADDR=`ip address |grep ens|grep inet|awk '{print $2}'| awk -F / '{print $1}'`
-HOSTNAME=`hostname`
+IP_ADDR=$(ip address |grep ens|grep inet|awk '{print $2}'| awk -F / '{print $1}')
+HOST_NAME=$(hostname)
-echo "$IP_ADDR $HOSTNAME" >> /etc/hosts
+echo "$IP_ADDR $HOST_NAME" >> /etc/hosts
docker login -u docker -p docker nexus3.onap.org:10001
diff --git a/docs/openstack-k8s-workernode.sh b/docs/openstack-k8s-workernode.sh
index 3f32d050a9..8b1b9e41ee 100644
--- a/docs/openstack-k8s-workernode.sh
+++ b/docs/openstack-k8s-workernode.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
DOCKER_VERSION=18.09.5
@@ -18,10 +18,10 @@ systemctl daemon-reload
systemctl restart docker
apt-mark hold docker-ce
-IP_ADDR=`ip address |grep ens|grep inet|awk '{print $2}'| awk -F / '{print $1}'`
-HOSTNAME=`hostname`
+IP_ADDR=$(ip address |grep ens|grep inet|awk '{print $2}'| awk -F / '{print $1}')
+HOST_NAME=$(hostname)
-echo "$IP_ADDR $HOSTNAME" >> /etc/hosts
+echo "$IP_ADDR $HOST_NAME" >> /etc/hosts
docker login -u docker -p docker nexus3.onap.org:10001
diff --git a/docs/openstack-nfs-server.sh b/docs/openstack-nfs-server.sh
index 1db04eaff6..395d04f27c 100644
--- a/docs/openstack-nfs-server.sh
+++ b/docs/openstack-nfs-server.sh
@@ -1,11 +1,11 @@
-#!/bin/bash
+#!/bin/sh
apt-get update
-IP_ADDR=`ip address |grep ens|grep inet|awk '{print $2}'| awk -F / '{print $1}'`
-HOSTNAME=`hostname`
+IP_ADDR=$(ip address |grep ens|grep inet|awk '{print $2}'| awk -F / '{print $1}')
+HOST_NAME=$(hostname)
-echo "$IP_ADDR $HOSTNAME" >> /etc/hosts
+echo "$IP_ADDR $HOST_NAME" >> /etc/hosts
sudo apt-get install make -y
diff --git a/kubernetes/helm/plugins/deploy/deploy.sh b/kubernetes/helm/plugins/deploy/deploy.sh
index ce8e80225f..4fec3984db 100755
--- a/kubernetes/helm/plugins/deploy/deploy.sh
+++ b/kubernetes/helm/plugins/deploy/deploy.sh
@@ -251,7 +251,7 @@ deploy() {
fi
if [ "$DELAY" = "true" ]; then
echo sleep 3m
- sleep 3m
+ sleep 180
fi
else
array=($(echo "$ALL_HELM_RELEASES" | grep "${RELEASE}-${subchart}"))
diff --git a/kubernetes/helm/plugins/undeploy/undeploy.sh b/kubernetes/helm/plugins/undeploy/undeploy.sh
index 790f84fda9..35fc4ca251 100755
--- a/kubernetes/helm/plugins/undeploy/undeploy.sh
+++ b/kubernetes/helm/plugins/undeploy/undeploy.sh
@@ -49,4 +49,4 @@ case "${1:-"help"}" in
;;
esac
-exit 0 \ No newline at end of file
+exit 0
diff --git a/kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh b/kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh
index 411ed8e667..40341bec11 100644
--- a/kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh
+++ b/kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh
@@ -109,11 +109,11 @@ docker_temp_server_start() {
for i in {30..0}; do
# only use the root password if the database has already been initializaed
# so that it won't try to fill in a password file when it hasn't been set yet
- extraArgs=()
+ extraArgs=""
if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
- extraArgs+=( '--dont-use-mysql-root-password' )
+ extraArgs=${extraArgs}" --dont-use-mysql-root-password"
fi
- if echo 'SELECT 1' |docker_process_sql "${extraArgs[@]}" --database=mysql >/dev/null 2>&1; then
+ if echo 'SELECT 1' |docker_process_sql ${extraArgs} --database=mysql >/dev/null 2>&1; then
break
fi
sleep 1
@@ -156,15 +156,15 @@ docker_create_db_directories() {
# initializes the database directory
docker_init_database_dir() {
mysql_note "Initializing database files"
- installArgs=( --datadir="$DATADIR" --rpm )
+ installArgs=" --datadir=$DATADIR --rpm "
if { mysql_install_db --help || :; } | grep -q -- '--auth-root-authentication-method'; then
# beginning in 10.4.3, install_db uses "socket" which only allows system user root to connect, switch back to "normal" to allow mysql root without a password
# see https://github.com/MariaDB/server/commit/b9f3f06857ac6f9105dc65caae19782f09b47fb3
# (this flag doesn't exist in 10.0 and below)
- installArgs+=( --auth-root-authentication-method=normal )
+ installArgs=${installArgs}" --auth-root-authentication-method=normal"
fi
# "Other options are passed to mysqld." (so we pass all "mysqld" arguments directly here)
- mysql_install_db "${installArgs[@]}" "${@:2}"
+ mysql_install_db ${installArgs} "${@:2}"
mysql_note "Database files initialized"
}
@@ -195,9 +195,9 @@ docker_setup_env() {
# ie: docker_process_sql --database=mydb <<<'INSERT ...'
# ie: docker_process_sql --dont-use-mysql-root-password --database=mydb <my-file.sql
docker_process_sql() {
- passfileArgs=()
+ passfileArgs=""
if [ '--dont-use-mysql-root-password' = "$1" ]; then
- passfileArgs+=( "$1" )
+ passfileArgs=${passfileArgs}" $1"
shift
fi
# args sent in can override this db, since they will be later in the command
@@ -205,7 +205,7 @@ docker_process_sql() {
set -- --database="$MYSQL_DATABASE" "$@"
fi
- mysql --defaults-extra-file=<( _mysql_passfile "${passfileArgs[@]}") --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@"
+ mysql --defaults-extra-file=<( _mysql_passfile ${passfileArgs}) --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@"
}
# Initializes database with timezone info and root password, plus optional extra db/user
diff --git a/kubernetes/robot/demo-k8s.sh b/kubernetes/robot/demo-k8s.sh
index 099f80ccff..5e4e216c95 100755
--- a/kubernetes/robot/demo-k8s.sh
+++ b/kubernetes/robot/demo-k8s.sh
@@ -222,7 +222,7 @@ ETEHOME=/var/opt/ONAP
if [ $execscript ]; then
for script in $(ls -1 "$DIR/$SCRIPTDIR"); do
- [ -f "$DIR/$SCRIPTDIR/$script" ] && [ -x "$DIR/$SCRIPTDIR/$script" ] && source "$DIR/$SCRIPTDIR/$script"
+ [ -f "$DIR/$SCRIPTDIR/$script" ] && [ -x "$DIR/$SCRIPTDIR/$script" ] && . "$DIR/$SCRIPTDIR/$script"
done
fi
diff --git a/kubernetes/robot/ete-k8s.sh b/kubernetes/robot/ete-k8s.sh
index 15d07fb3ee..01cf0922fa 100755
--- a/kubernetes/robot/ete-k8s.sh
+++ b/kubernetes/robot/ete-k8s.sh
@@ -78,7 +78,7 @@ ETEHOME=/var/opt/ONAP
if [ "${!#}" = "execscript" ]; then
for script in $(ls -1 "$DIR/$SCRIPTDIR"); do
- [ -f "$DIR/$SCRIPTDIR/$script" ] && [ -x "$DIR/$SCRIPTDIR/$script" ] && source "$DIR/$SCRIPTDIR/$script"
+ [ -f "$DIR/$SCRIPTDIR/$script" ] && [ -x "$DIR/$SCRIPTDIR/$script" ] && . "$DIR/$SCRIPTDIR/$script"
done
fi
diff --git a/kubernetes/robot/eteHelm-k8s.sh b/kubernetes/robot/eteHelm-k8s.sh
index d5e2fa41c3..8b74da77f8 100755
--- a/kubernetes/robot/eteHelm-k8s.sh
+++ b/kubernetes/robot/eteHelm-k8s.sh
@@ -46,7 +46,7 @@ ETEHOME=/var/opt/ONAP
if [ "${!#}" = "execscript" ]; then
for script in $(ls -1 "$DIR/$SCRIPTDIR"); do
- [ -f "$DIR/$SCRIPTDIR/$script" ] && [ -x "$DIR/$SCRIPTDIR/$script" ] && source "$DIR/$SCRIPTDIR/$script"
+ [ -f "$DIR/$SCRIPTDIR/$script" ] && [ -x "$DIR/$SCRIPTDIR/$script" ] && . "$DIR/$SCRIPTDIR/$script"
done
fi
diff --git a/kubernetes/sdnc/components/sdnc-prom/resources/bin/ensureSdncActive.sh b/kubernetes/sdnc/components/sdnc-prom/resources/bin/ensureSdncActive.sh
index feb6662196..099103ca79 100755
--- a/kubernetes/sdnc/components/sdnc-prom/resources/bin/ensureSdncActive.sh
+++ b/kubernetes/sdnc/components/sdnc-prom/resources/bin/ensureSdncActive.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-{{/*
+{{/*
# Copyright © 2018 Amdocs
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/kubernetes/sdnc/components/sdnc-prom/resources/bin/ensureSdncStandby.sh b/kubernetes/sdnc/components/sdnc-prom/resources/bin/ensureSdncStandby.sh
index 94858339e7..05a17017ab 100755
--- a/kubernetes/sdnc/components/sdnc-prom/resources/bin/ensureSdncStandby.sh
+++ b/kubernetes/sdnc/components/sdnc-prom/resources/bin/ensureSdncStandby.sh
@@ -1,6 +1,6 @@
-#!/bin/bash
-{{/*
+#!/bin/sh
+{{/*
# Copyright © 2018 Amdocs
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/kubernetes/sdnc/resources/geo/bin/switchVoting.sh b/kubernetes/sdnc/resources/geo/bin/switchVoting.sh
index 65b76265fc..a276854d5c 100755
--- a/kubernetes/sdnc/resources/geo/bin/switchVoting.sh
+++ b/kubernetes/sdnc/resources/geo/bin/switchVoting.sh
@@ -1,6 +1,6 @@
-#!/bin/bash
-{{/*
+#!/bin/sh
+{{/*
# Copyright © 2018 Amdocs
#
# Licensed under the Apache License, Version 2.0 (the "License");