aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Lambert <guillaume.lambert@orange.com>2021-04-29 14:12:24 +0200
committerGuillaume Lambert <guillaume.lambert@orange.com>2021-06-02 07:52:26 +0000
commitcf0be4349201f9f2e64b3b1dc4ebe8ae6def9588 (patch)
tree5ca34124aae70b4323c31995fec26b3c5e2ae573
parent84b962398213641e656e8d1750b83f480f531563 (diff)
[COMMON] Get rid of "x-hack" in shell scripts
$ find . -name *.sh -print |xargs grep -l '"x'| xargs sed -i 's/"x/"/g' The "x-hack" is a historical workaround for some old UNIX shells with buggy condition comparison code. None of them is still used today. Recent POSIX specifications now guarantee it should work without it in any modern POSIX shell. More details at https://www.vidarholen.net/contents/blog/?p=1035 https://github.com/koalaman/shellcheck/wiki/SC2268 Issue-ID: OOM-2643 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com> Change-Id: Ic01bbc5faee9492dba5b5d4dea0f659540da2c24
-rwxr-xr-xkubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh4
-rwxr-xr-xkubernetes/so/resources/config/docker-files/scripts/start-jboss-server.sh4
2 files changed, 4 insertions, 4 deletions
diff --git a/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh b/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh
index 717ea6679c..68b50e1ad6 100755
--- a/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh
+++ b/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh
@@ -83,7 +83,7 @@ then
show databases like 'sdnctl';
END
)
- if [ "x${sdnc_db_exists}" = "x" ]
+ if [ "${sdnc_db_exists}" = "" ]
then
echo "Installing SDNC database"
${SDNC_HOME}/bin/installSdncDb.sh
@@ -92,7 +92,7 @@ END
show databases like 'appcctl';
END
)
- if [ "x${appc_db_exists}" = "x" ]
+ if [ "${appc_db_exists}" = "" ]
then
echo "Installing APPC database"
${APPC_HOME}/bin/installAppcDb.sh
diff --git a/kubernetes/so/resources/config/docker-files/scripts/start-jboss-server.sh b/kubernetes/so/resources/config/docker-files/scripts/start-jboss-server.sh
index 52ba27ddca..3a9ef84834 100755
--- a/kubernetes/so/resources/config/docker-files/scripts/start-jboss-server.sh
+++ b/kubernetes/so/resources/config/docker-files/scripts/start-jboss-server.sh
@@ -37,7 +37,7 @@ trap "kill -TERM $JBOSS_PID" INT
trap "kill -QUIT $JBOSS_PID" QUIT
trap "kill -PIPE $JBOSS_PID" PIPE
trap "kill -TERM $JBOSS_PID" TERM
-if [ "x$JBOSS_PIDFILE" != "x" ]; then
+if [ "$JBOSS_PIDFILE" != "" ]; then
echo $JBOSS_PID > $JBOSS_PIDFILE
fi
# Wait until the background process exits
@@ -60,6 +60,6 @@ if [ "$JBOSS_STATUS" -ne 10 ]; then
# Wait for a complete shudown
wait $JBOSS_PID 2>/dev/null
fi
-if [ "x$JBOSS_PIDFILE" != "x" ]; then
+if [ "$JBOSS_PIDFILE" != "" ]; then
grep "$JBOSS_PID" $JBOSS_PIDFILE && rm $JBOSS_PIDFILE
fi