2015-03-12 23:32:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
## @licence AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
|
|
|
|
## @author Copyright (C) 2015 Robin Schneider <ypid@riseup.net>
|
|
|
|
|
|
|
|
if [ -z "$OPENVPN" ]; then
|
|
|
|
export OPENVPN="$PWD"
|
|
|
|
fi
|
|
|
|
if ! source "$OPENVPN/ovpn_env.sh"; then
|
|
|
|
echo "Could not source $OPENVPN/ovpn_env.sh."
|
|
|
|
exit 1
|
|
|
|
fi
|
2015-03-12 23:43:50 +00:00
|
|
|
if [ -z "$EASYRSA_PKI" ]; then
|
|
|
|
export EASYRSA_PKI="$OPENVPN/pki"
|
|
|
|
fi
|
2015-03-12 23:32:40 +00:00
|
|
|
|
|
|
|
pushd "$EASYRSA_PKI"
|
|
|
|
for name in issued/*.crt; do
|
|
|
|
name=${name%.crt}
|
|
|
|
name=${name#issued/}
|
|
|
|
if [ "$name" != "$OVPN_CN" ]; then
|
|
|
|
ovpn_getclient "$name" separated
|
|
|
|
ovpn_getclient "$name" combined-save
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
popd
|