Skip to content

Commit d44fb37

Browse files
committed
feat: 新增支持配置ccd
1 parent e5bd02f commit d44fb37

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

build/docker-entrypoint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ auth-user-pass-verify /usr/lib/openvpn/plugins/openvpn-auth via-env
5555
client-disconnect "/usr/bin/docker-entrypoint.sh addhistory"
5656
script-security 3
5757
status $OVPN_DATA/openvpn-status.log
58+
client-config-dir $OVPN_DATA/ccd
59+
keepalive 10 60
5860
duplicate-cn
61+
client-to-client
5962
max-clients $OVPN_MAXCLIENTS
6063
management ${OVPN_MANAGEMENT/:/ }
6164
verb 2
@@ -330,6 +333,8 @@ add_history(){
330333
################################################################################################
331334

332335
if [ "$1" == "--init" ]; then
336+
mkdir -p $OVPN_DATA/ccd
337+
333338
init_pki
334339
init_config
335340
exit 0
@@ -346,6 +351,10 @@ case $1 in
346351
exit 1
347352
fi
348353

354+
if [ -n "$5" ]; then
355+
echo -e "$5" > $OVPN_DATA/ccd/$2
356+
fi
357+
349358
$(genclient $2 $3 "$4")
350359
exit 0
351360
;;

0 commit comments

Comments
 (0)