Skip to content

Commit

Permalink
Merge pull request #56 from e0ne/no-sleep
Browse files Browse the repository at this point in the history
Optionally avoid sleeping in entrypoint.sh
  • Loading branch information
SchSeba authored Apr 26, 2024
2 parents 5edb8eb + 5dbde41 commit 899374d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions images/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -e
# Set known directories.
CNI_BIN_DIR="/host/opt/cni/bin"
RDMA_CNI_BIN_FILE="/usr/bin/rdma"
NO_SLEEP=0

# Give help text for parameters.
usage()
Expand All @@ -18,6 +19,7 @@ usage()
printf "\t-h --help\n"
printf "\t--cni-bin-dir=%s\n" "$CNI_BIN_DIR"
printf "\t--rdma-cni-bin-file=%s\n" "$RDMA_CNI_BIN_FILE"
printf "\t--no-sleep\n"
}

# Parse parameters given as arguments to this script.
Expand All @@ -35,6 +37,9 @@ while [ "$1" != "" ]; do
--rdma-cni-bin-file)
RDMA_CNI_BIN_FILE=$VALUE
;;
--no-sleep)
NO_SLEEP=1
;;
*)
/bin/echo "ERROR: unknown parameter \"$PARAM\""
usage
Expand All @@ -57,6 +62,10 @@ done
# Copy file into proper place.
cp -f "$RDMA_CNI_BIN_FILE" "$CNI_BIN_DIR"

if [ $NO_SLEEP -eq 1 ]; then
exit 0
fi

echo "Entering sleep... (success)"
trap : TERM INT

Expand Down

0 comments on commit 899374d

Please sign in to comment.