summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Lambert <guillaume.lambert@orange.com>2021-03-10 14:02:13 +0100
committerguillaume.lambert <guillaume.lambert@orange.com>2021-09-06 09:01:11 +0200
commit42f91fc8f9467f9f7fb9ac7e6349b33964b63127 (patch)
tree9ea70aca88543948c7247bad17217ab94c296ea4
parent3980a8cbeb63c885b123ac50033e32ed996bb39a (diff)
[COMMON] Fix ${foo:3[:1]} bashisms
pointed out by checkbashisms Issue-ID: OOM-264 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com> Change-Id: Ief3b2595a55f0e7a0a2e7ab05857848c99ce42f9
-rwxr-xr-xkubernetes/config/prepull_docker.sh2
-rwxr-xr-xkubernetes/helm/plugins/deploy/deploy.sh8
-rwxr-xr-xkubernetes/helm/plugins/undeploy/undeploy.sh2
-rwxr-xr-xkubernetes/msb/components/msb-consul/resources/docker-entrypoint.sh2
-rw-r--r--kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh4
5 files changed, 9 insertions, 9 deletions
diff --git a/kubernetes/config/prepull_docker.sh b/kubernetes/config/prepull_docker.sh
index 590d651f87..efd0bd14d3 100755
--- a/kubernetes/config/prepull_docker.sh
+++ b/kubernetes/config/prepull_docker.sh
@@ -102,7 +102,7 @@ do
for line in `parse_yaml $filename`
do
#skiping commented line
- if [ "${line:0:1}" != '#' ]; then
+ if echo "$line" | grep -v '^#' >/dev/null; then
#find all image subtag inside converted values.yaml file's lines
if echo $line | grep -q $IMAGE_TEXT ; then
#find imageName inside line
diff --git a/kubernetes/helm/plugins/deploy/deploy.sh b/kubernetes/helm/plugins/deploy/deploy.sh
index d863a152a5..536be7b4a9 100755
--- a/kubernetes/helm/plugins/deploy/deploy.sh
+++ b/kubernetes/helm/plugins/deploy/deploy.sh
@@ -96,9 +96,9 @@ deploy() {
RELEASE=$1
CHART_URL=$2
- FLAGS=${@:3}
- CHART_REPO="$(echo "$CHART_URL" |cut -d'/' -f1)"
- CHART_NAME="$(echo "$CHART_URL" |cut -d'/' -f2)"
+ FLAGS=$(echo ${@} | sed 's/^ *[^ ]* *[^ ]* *//')
+ CHART_REPO="$(echo "$CHART_URL" | cut -d'/' -f1)"
+ CHART_NAME="$(echo "$CHART_URL" | cut -d'/' -f2)"
if expr "$HELM_VER" : "v3\..*" ; then
CACHE_DIR=~/.local/share/helm/plugins/deploy/cache
else
@@ -287,7 +287,7 @@ case "${1:-"help"}" in
usage
;;
*)
- deploy $1 $2 ${@:3}
+ deploy $1 $2 $(echo ${@} | sed 's/^ *[^ ]* *[^ ]* *//')
;;
esac
diff --git a/kubernetes/helm/plugins/undeploy/undeploy.sh b/kubernetes/helm/plugins/undeploy/undeploy.sh
index 35fc4ca251..72c64244c0 100755
--- a/kubernetes/helm/plugins/undeploy/undeploy.sh
+++ b/kubernetes/helm/plugins/undeploy/undeploy.sh
@@ -45,7 +45,7 @@ case "${1:-"help"}" in
usage
;;
*)
- undeploy $1 ${@:2}
+ undeploy $1 $(echo ${@} | sed 's/^ *[^ ]* *//')
;;
esac
diff --git a/kubernetes/msb/components/msb-consul/resources/docker-entrypoint.sh b/kubernetes/msb/components/msb-consul/resources/docker-entrypoint.sh
index 0cd46167e4..cbcbf7a8bf 100755
--- a/kubernetes/msb/components/msb-consul/resources/docker-entrypoint.sh
+++ b/kubernetes/msb/components/msb-consul/resources/docker-entrypoint.sh
@@ -53,7 +53,7 @@ fi
# If the user is trying to run Consul directly with some arguments, then
# pass them to Consul.
-if [ "${1:0:1}" = '-' ]; then
+if echo "$1" | grep '^-' >/dev/null; then
set -- consul "$@"
fi
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 3d5e13ff5a..b416fdd5d8 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
@@ -164,7 +164,7 @@ docker_init_database_dir() {
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} "$(echo ${@} | sed 's/^ *[^ ]* *//')"
mysql_note "Database files initialized"
}
@@ -313,7 +313,7 @@ _mysql_want_help() {
_main() {
# if command starts with an option, prepend mysqld
- if [ "${1:0:1}" = '-' ]; then
+ if echo "$1" | grep '^-' >/dev/null; then
set -- mysqld "$@"
fi