diff --git a/packages/core/examples/simple-asset-transfer/fabric/scripts/fabric-install.sh b/packages/core/examples/simple-asset-transfer/fabric/scripts/fabric-install.sh index 65093a8f0c..af19285a6b 100755 --- a/packages/core/examples/simple-asset-transfer/fabric/scripts/fabric-install.sh +++ b/packages/core/examples/simple-asset-transfer/fabric/scripts/fabric-install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Pre-requesits install diff --git a/packages/core/examples/simple-asset-transfer/fabric/scripts/runApp.sh b/packages/core/examples/simple-asset-transfer/fabric/scripts/runApp.sh index d77c63b15b..3f169d49c6 100755 --- a/packages/core/examples/simple-asset-transfer/fabric/scripts/runApp.sh +++ b/packages/core/examples/simple-asset-transfer/fabric/scripts/runApp.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Copyright IBM Corp. All Rights Reserved. # diff --git a/packages/core/examples/simple-asset-transfer/fabric/scripts/start.sh b/packages/core/examples/simple-asset-transfer/fabric/scripts/start.sh index e90fb8588e..488963d154 100755 --- a/packages/core/examples/simple-asset-transfer/fabric/scripts/start.sh +++ b/packages/core/examples/simple-asset-transfer/fabric/scripts/start.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Start the API wrapping methods to interact with fabric if [ ! -d "../logs" ]; then @@ -7,7 +7,7 @@ if [ ! -d "../logs" ]; then fi # Kill old SDK server -fuser -k -n tcp 4000 +pid=$(lsof -i tcp:4000 -t); [ -z "$pid" ] || kill -TERM $pid || kill -KILL $pid path_to_log_file="../logs/start.log" diff --git a/packages/core/examples/simple-asset-transfer/package.json b/packages/core/examples/simple-asset-transfer/package.json index f703d0bbbd..adc515aae1 100644 --- a/packages/core/examples/simple-asset-transfer/package.json +++ b/packages/core/examples/simple-asset-transfer/package.json @@ -18,7 +18,7 @@ "corda": "cd corda/build/scripts && ./start_corda_components.sh ../../logs && cd ../../../", "corda:down": "cd corda/build/scripts && ./stop_corda_components.sh ../../logs && cd ../../../", "fabric": "cd fabric/scripts && ./start.sh", - "fabric:down": "fuser -k -n tcp 4000 ; docker-compose -f fabric/artifacts/docker-compose.yaml rm -sf", + "fabric:down": "pid=$(lsof -i tcp:4000 -t); [ -z \"$pid\" ] || kill -TERM $pid || kill -KILL $pid; docker-compose -f fabric/artifacts/docker-compose.yaml rm -sf", "fabric:log": "docker-compose -f fabric/artifacts/docker-compose.yaml logs -f", "fed:build": "docker build --no-cache --force-rm -t federation/validator .", "fed:fabric": "docker-compose -p federation-fabric -f ./federations/docker-compose-fabric.yml --compatibility up --renew-anon-volumes -d", diff --git a/packages/core/tools/ci.sh b/packages/core/tools/ci.sh index abe33cce8b..0e261b40ad 100755 --- a/packages/core/tools/ci.sh +++ b/packages/core/tools/ci.sh @@ -1,10 +1,11 @@ -#!/bin/bash +#!/usr/bin/env bash ### ### Continous Integration Shell Script ### ### Designed to be re-entrant on a local dev machine as well, not just on a ### newly pulled up VM. ### +echo $BASH_VERSION STARTED_AT=`date +%s` SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" @@ -129,7 +130,7 @@ function mainTask() ENDED_AT=`date +%s` runtime=$((ENDED_AT-STARTED_AT)) - echo "$(date -Iseconds) [CI] SUCCESS - runtime=$runtime seconds." + echo "$(date +%FT%T%z) [CI] SUCCESS - runtime=$runtime seconds." exit 0 } @@ -141,7 +142,7 @@ function onTaskFailure() ENDED_AT=`date +%s` runtime=$((ENDED_AT-STARTED_AT)) - echo "$(date -Iseconds) [CI] FAILURE - runtime=$runtime seconds." + echo "$(date +%FT%T%z) [CI] FAILURE - runtime=$runtime seconds." exit 1 } diff --git a/packages/core/tools/configure.sh b/packages/core/tools/configure.sh index 801b24f4ee..6951a19e59 100755 --- a/packages/core/tools/configure.sh +++ b/packages/core/tools/configure.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/usr/bin/env bash -x # Remove existing software that we want specific version. sudo apt purge nodejs openjdk-\* diff --git a/packages/core/tools/dump-all-logs.sh b/packages/core/tools/dump-all-logs.sh index 042e56bf5a..09148e8e66 100755 --- a/packages/core/tools/dump-all-logs.sh +++ b/packages/core/tools/dump-all-logs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ### ### Continous Integration Shell Script --- Dump All Logs ### diff --git a/tools/cleanup.sh b/tools/cleanup.sh index 97b9de38b8..5b31d8924c 100755 --- a/tools/cleanup.sh +++ b/tools/cleanup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cd $(dirname $0)/../examples/simple-asset-transfer/