File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ function usage() {
18
18
echo ' rm|del # Remove PKI'
19
19
echo ' restore [file] # Restore config'
20
20
echo ' subject add NAME {client|server} [nopass] [easy-rsa args]'
21
- echo ' gen-ovpn SUBNAME [file] # Generate .ovpn file'
22
- echo ' gen-pkg SUBNAME [file] # Generate config package'
21
+ echo ' gen-ovpn SUBNAME [file] # Generate .ovpn file (TEMPLATE=<custom template in openvpn dir) '
22
+ echo ' gen-pkg SUBNAME [file] # Generate config package (TEMPLATE=<custom template in openvpn dir) '
23
23
echo ' import-req FILE # Import signing request'
24
24
echo ' renew SUBNAME {client|server} [easy-rsa args]'
25
25
echo ' revoke SUBNAME'
Original file line number Diff line number Diff line change @@ -36,8 +36,9 @@ function generate_ovpn() {
36
36
fi
37
37
38
38
# Start with client config template if it exist
39
- if [ -f "$OPENVPN_DIR/openvpn-template.conf" ]; then
40
- $RUNCMD bash -c "cat $OPENVPN_DIR/openvpn-template.conf > $OVPN_FILE"
39
+ TEMPLATE=${TEMPLATE:='openvpn-template.conf'}
40
+ if [ -f "$OPENVPN_DIR/$TEMPLATE" ]; then
41
+ $RUNCMD bash -c "cat $OPENVPN_DIR/$TEMPLATE > $OVPN_FILE"
41
42
else
42
43
$RUNCMD touch $OVPN_FILE
43
44
fi
@@ -122,8 +123,9 @@ function generate_pkg() {
122
123
$RUNCMD mkdir -p $TMP_DIR/openvpn
123
124
124
125
# Start with client config template if it exist
125
- if [ -f "$OPENVPN_DIR/openvpn-template.conf" ]; then
126
- $RUNCMD bash -c "cat $OPENVPN_DIR/openvpn-template.conf > $TMP_CONFIG"
126
+ TEMPLATE=${TEMPLATE:='openvpn-template.conf'}
127
+ if [ -f "$OPENVPN_DIR/$TEMPLATE" ]; then
128
+ $RUNCMD bash -c "cat $OPENVPN_DIR/$TEMPLATE > $TMP_CONFIG"
127
129
else
128
130
$RUNCMD touch $TMP_CONFIG
129
131
fi
You can’t perform that action at this time.
0 commit comments