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:
51
51
hook # Example hook configs
52
52
module # Modules for openvpn
53
53
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
54
59
init # Init container
60
+ learn-address
55
61
route-up # After routes are added
56
62
route-pre-down # Before routes are removed
57
63
up # After interface is up
58
- down # After interface is down
59
- client-connect # Client connected
60
- client-disconnect # Client disconnected
61
- learn-address
62
64
tls-verify # Check certificate
63
- auth # On authentication (needs to be enabled in config)
64
65
system.conf # System OpenVPN config file (do not edit, unless instructed)
65
66
include-server.conf # File that includes all server configuration files (automatically generated)
66
67
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() {
10
10
echo " Usage: run_hooks HOOK_NAME [ARGS]"
11
11
echo " "
12
12
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"
17
24
}
18
25
19
26
# Check if hook name is set
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ script-security 2
20
20
route-up "/app/bin/run_hooks route-up"
21
21
route-pre-down "/app/bin/run_hooks route-pre-down"
22
22
up "/app/bin/run_hooks up"
23
+ down-pre
23
24
down "/app/bin/run_hooks down"
24
25
client-connect "/app/bin/run_hooks client-connect"
25
26
client-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 3
3
# File which indicates that full init was already done before
4
4
FLAG_FILE=/config/donotdelete
5
5
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)
7
7
OVPN_DIR=(ccd client server)
8
8
9
9
FIRST_SETUP=0
You can’t perform that action at this time.
0 commit comments