-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from theohbrothers/enhancement/enhance-docker-…
…entrypoint.sh-with-easyrsa-subcommand-detection-with-fallback-on-binary Enhancement: Enhance `/docker-entrypoint.sh` with `easyrsa` subcommand detection with fallback on binary
- Loading branch information
Showing
15 changed files
with
240 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
@' | ||
#!/bin/sh | ||
set -eu | ||
set -aeo pipefail | ||
if [ $# -gt 0 ]; then | ||
# Get all subcommands. 'help' is also a subcommand | ||
SUBCOMMANDS=$( ./easyrsa | awk "/^'help'/,/^DIRECTORY/" | grep -vE "^'help'|^DIRECTORY|^\s*$" | awk '{print $1}'; echo help ) | ||
if echo "$SUBCOMMANDS" | grep "^$1$"; then | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
fi | ||
else | ||
exec "$EASYRSA/easyrsa" "$@" | ||
fi | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
'@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
set -aeo pipefail | ||
if [ $# -gt 0 ]; then | ||
# Get all subcommands. 'help' is also a subcommand | ||
SUBCOMMANDS=$( ./easyrsa | awk "/^'help'/,/^DIRECTORY/" | grep -vE "^'help'|^DIRECTORY|^\s*$" | awk '{print $1}'; echo help ) | ||
if echo "$SUBCOMMANDS" | grep "^$1$"; then | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
|
||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
fi | ||
else | ||
exec "$EASYRSA/easyrsa" "$@" | ||
fi | ||
|
||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
set -aeo pipefail | ||
if [ $# -gt 0 ]; then | ||
# Get all subcommands. 'help' is also a subcommand | ||
SUBCOMMANDS=$( ./easyrsa | awk "/^'help'/,/^DIRECTORY/" | grep -vE "^'help'|^DIRECTORY|^\s*$" | awk '{print $1}'; echo help ) | ||
if echo "$SUBCOMMANDS" | grep "^$1$"; then | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
|
||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
fi | ||
else | ||
exec "$EASYRSA/easyrsa" "$@" | ||
fi | ||
|
||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
set -aeo pipefail | ||
if [ $# -gt 0 ]; then | ||
# Get all subcommands. 'help' is also a subcommand | ||
SUBCOMMANDS=$( ./easyrsa | awk "/^'help'/,/^DIRECTORY/" | grep -vE "^'help'|^DIRECTORY|^\s*$" | awk '{print $1}'; echo help ) | ||
if echo "$SUBCOMMANDS" | grep "^$1$"; then | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
|
||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
fi | ||
else | ||
exec "$EASYRSA/easyrsa" "$@" | ||
fi | ||
|
||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
set -aeo pipefail | ||
if [ $# -gt 0 ]; then | ||
# Get all subcommands. 'help' is also a subcommand | ||
SUBCOMMANDS=$( ./easyrsa | awk "/^'help'/,/^DIRECTORY/" | grep -vE "^'help'|^DIRECTORY|^\s*$" | awk '{print $1}'; echo help ) | ||
if echo "$SUBCOMMANDS" | grep "^$1$"; then | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
|
||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
fi | ||
else | ||
exec "$EASYRSA/easyrsa" "$@" | ||
fi | ||
|
||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
set -aeo pipefail | ||
if [ $# -gt 0 ]; then | ||
# Get all subcommands. 'help' is also a subcommand | ||
SUBCOMMANDS=$( ./easyrsa | awk "/^'help'/,/^DIRECTORY/" | grep -vE "^'help'|^DIRECTORY|^\s*$" | awk '{print $1}'; echo help ) | ||
if echo "$SUBCOMMANDS" | grep "^$1$"; then | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
|
||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
fi | ||
else | ||
exec "$EASYRSA/easyrsa" "$@" | ||
fi | ||
|
||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
set -aeo pipefail | ||
if [ $# -gt 0 ]; then | ||
# Get all subcommands. 'help' is also a subcommand | ||
SUBCOMMANDS=$( ./easyrsa | awk "/^'help'/,/^DIRECTORY/" | grep -vE "^'help'|^DIRECTORY|^\s*$" | awk '{print $1}'; echo help ) | ||
if echo "$SUBCOMMANDS" | grep "^$1$"; then | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
|
||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
fi | ||
else | ||
exec "$EASYRSA/easyrsa" "$@" | ||
fi | ||
|
||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
set -aeo pipefail | ||
if [ $# -gt 0 ]; then | ||
# Get all subcommands. 'help' is also a subcommand | ||
SUBCOMMANDS=$( ./easyrsa | awk "/^'help'/,/^DIRECTORY/" | grep -vE "^'help'|^DIRECTORY|^\s*$" | awk '{print $1}'; echo help ) | ||
if echo "$SUBCOMMANDS" | grep "^$1$"; then | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
|
||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
fi | ||
else | ||
exec "$EASYRSA/easyrsa" "$@" | ||
fi | ||
|
||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
set -aeo pipefail | ||
if [ $# -gt 0 ]; then | ||
# Get all subcommands. 'help' is also a subcommand | ||
SUBCOMMANDS=$( ./easyrsa | awk "/^'help'/,/^DIRECTORY/" | grep -vE "^'help'|^DIRECTORY|^\s*$" | awk '{print $1}'; echo help ) | ||
if echo "$SUBCOMMANDS" | grep "^$1$"; then | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
|
||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
fi | ||
else | ||
exec "$EASYRSA/easyrsa" "$@" | ||
fi | ||
|
||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
set -aeo pipefail | ||
if [ $# -gt 0 ]; then | ||
# Get all subcommands. 'help' is also a subcommand | ||
SUBCOMMANDS=$( ./easyrsa | awk "/^'help'/,/^DIRECTORY/" | grep -vE "^'help'|^DIRECTORY|^\s*$" | awk '{print $1}'; echo help ) | ||
if echo "$SUBCOMMANDS" | grep "^$1$"; then | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
|
||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
fi | ||
else | ||
exec "$EASYRSA/easyrsa" "$@" | ||
fi | ||
|
||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
set -aeo pipefail | ||
if [ $# -gt 0 ]; then | ||
# Get all subcommands. 'help' is also a subcommand | ||
SUBCOMMANDS=$( ./easyrsa | awk "/^'help'/,/^DIRECTORY/" | grep -vE "^'help'|^DIRECTORY|^\s*$" | awk '{print $1}'; echo help ) | ||
if echo "$SUBCOMMANDS" | grep "^$1$"; then | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
|
||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
fi | ||
else | ||
exec "$EASYRSA/easyrsa" "$@" | ||
fi | ||
|
||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
set -aeo pipefail | ||
if [ $# -gt 0 ]; then | ||
# Get all subcommands. 'help' is also a subcommand | ||
SUBCOMMANDS=$( ./easyrsa | awk "/^'help'/,/^DIRECTORY/" | grep -vE "^'help'|^DIRECTORY|^\s*$" | awk '{print $1}'; echo help ) | ||
if echo "$SUBCOMMANDS" | grep "^$1$"; then | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
|
||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
fi | ||
else | ||
exec "$EASYRSA/easyrsa" "$@" | ||
fi | ||
|
||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
set -aeo pipefail | ||
if [ $# -gt 0 ]; then | ||
# Get all subcommands. 'help' is also a subcommand | ||
SUBCOMMANDS=$( ./easyrsa | awk "/^'help'/,/^DIRECTORY/" | grep -vE "^'help'|^DIRECTORY|^\s*$" | awk '{print $1}'; echo help ) | ||
if echo "$SUBCOMMANDS" | grep "^$1$"; then | ||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
|
||
# Generate the command line. easy-rsa man: https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/README.quickstart.md | ||
echo "Generating command line" | ||
set "$EASYRSA/easyrsa" "$@" | ||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
fi | ||
else | ||
exec "$EASYRSA/easyrsa" "$@" | ||
fi | ||
|
||
# Exec | ||
echo "easyrsa command line: $@" | ||
exec "$@" | ||
exec "$@" |
Oops, something went wrong.