genconfig: Use servername if $1 not specified

* Set the common name to servername set during last ovpn_init if $1 is
  not passed in.
* Simplies re-running ovpn_genconfig when features are added.
This commit is contained in:
Kyle Manna 2014-06-29 23:04:42 -07:00
parent 20dc3d6ea0
commit 1aaf6a4359

View File

@ -6,7 +6,8 @@
set -ex set -ex
cn=$1 servername=$(cat "$OPENVPN/servername" 2> /dev/null)
cn=${1-$servername}
if [ -z "$cn" ]; then if [ -z "$cn" ]; then
echo "Common name not specified" echo "Common name not specified"