File tree Expand file tree Collapse file tree 5 files changed +28
-10
lines changed
Expand file tree Collapse file tree 5 files changed +28
-10
lines changed Original file line number Diff line number Diff line change @@ -51,16 +51,17 @@ Sections:
5151 hook # Example hook configs
5252 module # Modules for openvpn
5353 hooks # Put your custom scripts in one of subfolders
54+ auth # On authentication (needs to be enabled in config)
55+ client-connect # Client connected
56+ client-disconnect # Client disconnected
57+ down # After interface is down
58+ finish # Deinit container
5459 init # Init container
60+ learn-address
5561 route-up # After routes are added
5662 route-pre-down # Before routes are removed
5763 up # After interface is up
58- down # After interface is down
59- client-connect # Client connected
60- client-disconnect # Client disconnected
61- learn-address
6264 tls-verify # Check certificate
63- auth # On authentication (needs to be enabled in config)
6465 system.conf # System OpenVPN config file (do not edit, unless instructed)
6566 include-server.conf # File that includes all server configuration files (automatically generated)
6667 donotdelete # Leave this file alone, if deleted it triggers full setup
Original file line number Diff line number Diff line change @@ -10,10 +10,17 @@ function usage() {
1010 echo " Usage: run_hooks HOOK_NAME [ARGS]"
1111 echo " "
1212 echo " Hooks:"
13- echo " up saasas"
14- echo " down-pre asasss"
15- echo " down-post asasda"
16- echo " auth asdasd"
13+ echo " auth On OpenVPN client authentication"
14+ echo " client-connect On OpenVPN client connected"
15+ echo " client-disconnect On OpenVPN client disconnected"
16+ echo " finish On container shutdown"
17+ echo " init On container power on"
18+ echo " learn-address Client Address & Routes validation"
19+ echo " down Before/After TUN interface closed"
20+ echo " route-up After routes are added"
21+ echo " route-pre-down Before routes are removed"
22+ echo " tls-verify On OpenVPN client certificate verificaton"
23+ echo " up After TUN interface opened"
1724}
1825
1926# Check if hook name is set
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ script-security 2
2020route-up "/app/bin/run_hooks route-up"
2121route-pre-down "/app/bin/run_hooks route-pre-down"
2222up "/app/bin/run_hooks up"
23+ down-pre
2324down "/app/bin/run_hooks down"
2425client-connect "/app/bin/run_hooks client-connect"
2526client-disconnect "/app/bin/run_hooks client-disconnect"
Original file line number Diff line number Diff line change 1+ #!/usr/bin/with-contenv bash
2+
3+ #
4+ # Runs custom finish scripts in /config/hooks/finish
5+ #
6+
7+ run_hooks finish
8+
9+ exit $?
Original file line number Diff line number Diff line change 33# File which indicates that full init was already done before
44FLAG_FILE=/config/donotdelete
55
6- HOOKS_DIR=(init route-up route-pre-down up down client-connect client-disconnect learn-address tls-verify auth )
6+ HOOKS_DIR=(auth client-connect client-disconnect finish down init learn-address route-pre-down route-up up tls-verify)
77OVPN_DIR=(ccd client server)
88
99FIRST_SETUP=0
You can’t perform that action at this time.
0 commit comments