Skip to content

Commit

Permalink
Merge pull request #59 from leojonathanoh/fix/fix-docker-entrypoint.s…
Browse files Browse the repository at this point in the history
…h-printing-passed-arguments

Fix: Fix `docker-entrypoint.sh` printing passed arguments
  • Loading branch information
leojonathanoh authored Apr 6, 2024
2 parents 99d85eb + b17b5d8 commit 44c5cf9
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 72 deletions.
6 changes: 2 additions & 4 deletions generate/templates/docker-entrypoint.sh.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.0.1/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.0.2/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.0.3/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.0.4/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.0.5/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.0.6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.0.7/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.0.8/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.0.9/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.1.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.1.1/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.1.2/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.1.3/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.1.4/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.1.5/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.1.6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down
6 changes: 2 additions & 4 deletions variants/3.1.7/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -eu
if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then
exec "easyrsa" "$@"
fi
else
exec "easyrsa" "$@"
Expand Down

0 comments on commit 44c5cf9

Please sign in to comment.