Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced client management #36

Merged
merged 4 commits into from
Mar 21, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
EASYRSA_PKI might not be defined.
  • Loading branch information
ypid committed Mar 12, 2015
commit fd4a5dc38ebe850b1efb7d4d7280cd394b4bfd19
11 changes: 9 additions & 2 deletions bin/ovpn_getclient
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@ fi
set -e

if [ -z "$OPENVPN" ]; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would $OPENVPN or $EASYRSA_PKI ever be unset? They are defined in the Dockerfile and overriden with docker run -e .... Is there a situation that makes this necessary? Otherwise it's just adding noise to the script.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for this is simple. Users (including myself) might run this script outside of docker too.

OPENVPN="$PWD"
export OPENVPN="$PWD"
fi
source "$OPENVPN/ovpn_env.sh"
if ! source "$OPENVPN/ovpn_env.sh"; then
echo "Could not source $OPENVPN/ovpn_env.sh."
exit 1
fi
if [ -z "$EASYRSA_PKI" ]; then
export EASYRSA_PKI="$OPENVPN/pki"
fi

cn="$1"
parm="$2"

Expand Down
3 changes: 3 additions & 0 deletions bin/ovpn_getclient_all
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ if ! source "$OPENVPN/ovpn_env.sh"; then
echo "Could not source $OPENVPN/ovpn_env.sh."
exit 1
fi
if [ -z "$EASYRSA_PKI" ]; then
export EASYRSA_PKI="$OPENVPN/pki"
fi

pushd "$EASYRSA_PKI"
for name in issued/*.crt; do
Expand Down